From 06d823120f122fb9a9f0c291ad5b882efb17d199 Mon Sep 17 00:00:00 2001 From: mdw Date: Fri, 22 Oct 1999 22:47:50 +0000 Subject: [PATCH] Grammar changes. Also, don't enable SIGINT if it's currently ignored. --- fw.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/fw.c b/fw.c index 513cb23..e5537fc 100644 --- a/fw.c +++ b/fw.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: fw.c,v 1.4 1999/10/10 16:46:12 mdw Exp $ + * $Id: fw.c,v 1.5 1999/10/22 22:47:50 mdw Exp $ * * Port forwarding thingy * @@ -29,6 +29,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: fw.c,v $ + * Revision 1.5 1999/10/22 22:47:50 mdw + * Grammar changes. Also, don't enable SIGINT if it's currently ignored. + * * Revision 1.4 1999/10/10 16:46:12 mdw * New resolver to initialize. Also, include options for grammar and * options references. @@ -314,7 +317,7 @@ Exec options\n\ exec.env.[set] var [=] value\n\ \n\ Socket options\n\ - socket.conn [=] number\n\ + socket.conn [=] number|unlimited|one-shot\n\ socket.logging [=] yes|no\n\ socket.inet.[allow|deny] [from] address [/ address]\n\ socket.unix.fattr.*\n\ @@ -357,10 +360,20 @@ int main(int argc, char *argv[]) fattr_init(&fattr_global); scan_create(&sc); - /* --- Set up some signal handlers --- */ + /* --- Set up some signal handlers --- * + * + * Don't enable @SIGINT@ if the caller already disabled it. + */ + + { + struct sigaction sa; + + sig_add(&s_term, SIGTERM, fw_tidy, 0); + sigaction(SIGINT, 0, &sa); + if (sa.sa_handler != SIG_IGN) + sig_add(&s_int, SIGINT, fw_tidy, 0); + } - sig_add(&s_term, SIGTERM, fw_tidy, 0); - sig_add(&s_int, SIGINT, fw_tidy, 0); atexit(fw_exit); /* --- Parse command line options --- */ -- 2.11.0