From b17eed94661a6a6d9bd1a43c4545c0e255f95ab3 Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Tue, 2 Oct 2012 18:52:11 +0000 Subject: [PATCH] SIGTERM handler: use _exit(2), not exit(3) exit(3) is not async-signal safe (presumably due to atexit(3) processing), so use _exit(2) instead. This was clearly an omission from the original code which even had a comment to the effect that _exit(2) needed to be used. In all likelihood this never caused any problems as atexit(3) functionality is not used. --- src/daemonitor/700_signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/daemonitor/700_signal.c b/src/daemonitor/700_signal.c index e47edd1..f6d2346 100644 --- a/src/daemonitor/700_signal.c +++ b/src/daemonitor/700_signal.c @@ -45,7 +45,7 @@ void sigterm_handler(int signum __attribute__((unused))) /* uck -- we can't call exit() because it's not async-signal-safe, so we must call _exit() and * clean up manually, with no logging */ unlink(pidfile_filename); - exit(0); + _exit(0); }