From: Sam Tannous Date: Tue, 8 Jul 2014 19:15:46 +0000 (-0400) Subject: Add ignore handler for SIGHUP in lldpcli X-Git-Tag: 0.7.10~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=003620d3104b32d3fb34ae967e8037748fd661c8;p=thirdparty%2Flldpd.git Add ignore handler for SIGHUP in lldpcli lldpcli which is execed by lldpd is expected to resume lldpd operations. But in some cases, lldpcli can exiting because of SIGHUP. This fixes these cases. Signed-off-by: Roopa Prabhu Signed-off-by: Kanna Rajagopal Signed-off-by: Sam Tannous --- diff --git a/src/client/lldpcli.c b/src/client/lldpcli.c index 5e0d027e..47375918 100644 --- a/src/client/lldpcli.c +++ b/src/client/lldpcli.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include "client.h" @@ -426,6 +427,8 @@ main(int argc, char *argv[]) ctlname = lldpctl_get_default_transport(); + signal(SIGHUP, SIG_IGN); + /* Initialize logging */ while ((ch = getopt(argc, argv, options)) != -1) { switch (ch) { diff --git a/src/daemon/lldpd.c b/src/daemon/lldpd.c index d9575b96..05e323a4 100644 --- a/src/daemon/lldpd.c +++ b/src/daemon/lldpd.c @@ -1471,6 +1471,9 @@ lldpd_main(int argc, char *argv[], char *envp[]) /* Disable SIGPIPE */ signal(SIGPIPE, SIG_IGN); + /* Disable SIGHUP, until handlers are installed */ + signal(SIGHUP, SIG_IGN); + /* Configuration with lldpcli */ if (lldpcli) { log_debug("main", "invoking lldpcli for configuration");