diff options
-rw-r--r-- | ccan/daemonize/daemonize.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ccan/daemonize/daemonize.c b/ccan/daemonize/daemonize.c index 3c0a53a8..d4a0420e 100644 --- a/ccan/daemonize/daemonize.c +++ b/ccan/daemonize/daemonize.c @@ -15,8 +15,9 @@ bool daemonize(void) /* Separate from our parent via fork, so init inherits us. */ if ((pid = fork()) < 0) return false; + /* use _exit() to avoid triggering atexit() processing */ if (pid != 0) - exit(0); + _exit(0); /* Don't hold files open. */ close(STDIN_FILENO); |