diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-11-01 16:07:33 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-11-01 16:07:33 +0000 |
commit | 63c1617066a1bf202bd90ce646491e0808798c56 (patch) | |
tree | 0e6d1e36850d417ac724df99d66654bc9e0f1790 /libdaemon/dfork.c | |
parent | e09aa157f7095413011d952105a56e3940960682 (diff) |
use _exit() instead of exit() to terminate if forking fails
git-svn-id: file:///home/lennart/svn/public/libdaemon/trunk@100 153bfa13-eec0-0310-be40-b0cb6a0e1b4b
Diffstat (limited to 'libdaemon/dfork.c')
-rw-r--r-- | libdaemon/dfork.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libdaemon/dfork.c b/libdaemon/dfork.c index 5edcc75..5ed438d 100644 --- a/libdaemon/dfork.c +++ b/libdaemon/dfork.c @@ -227,7 +227,7 @@ pid_t daemon_fork(void) { } else { /* Second father */ close(pipe_fds[1]); - exit(0); + _exit(0); } fail: @@ -235,7 +235,7 @@ pid_t daemon_fork(void) { if (atomic_write(pipe_fds[1], &dpid, sizeof(dpid)) != sizeof(dpid)) daemon_log(LOG_ERR, "Failed to write error PID."); close(pipe_fds[1]); - exit(0); + _exit(0); } else { /* First father */ |