From b86735c478e908d84d2ad72cc8488c573c6ee552 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Wed, 21 Oct 2020 09:49:22 -0400 Subject: [PATCH] Minor signal handling fixes. --- src/ndhc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ndhc.c b/src/ndhc.c index 73dab98..d4c4a24 100644 --- a/src/ndhc.c +++ b/src/ndhc.c @@ -177,7 +177,7 @@ static void signal_handler(int signo) case SIGCHLD: { static const char errstr[] = "ndhc-master: Subprocess terminated unexpectedly. Exiting.\n"; safe_write(STDOUT_FILENO, errstr, sizeof errstr - 1); - exit(EXIT_FAILURE); + _exit(EXIT_FAILURE); } case SIGINT: case SIGTERM: l_signal_exit = 1; break; @@ -298,8 +298,8 @@ static void do_ndhc_work(void) pfds[5].fd = cs.listenFd; had_event = false; if (poll(pfds, 6, timeout) < 0) { - if (errno == EINTR) continue; - else suicide("poll failed"); + if (errno != EINTR) + suicide("poll failed"); } bool sev_dhcp = false;