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.
This commit is contained in:
parent
b26bd15791
commit
b17eed9466
|
@ -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
|
/* 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 */
|
* clean up manually, with no logging */
|
||||||
unlink(pidfile_filename);
|
unlink(pidfile_filename);
|
||||||
exit(0);
|
_exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue