From 57542dd67af0dce7b7c0656276bf60976e1806ca Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 15 May 2007 03:18:52 +0000 Subject: [PATCH] * utils/start-stop-daemon.c (daemonize): Use _exit instead of exit, to avoid side effects while the parents terminate. --- ChangeLog | 5 +++++ utils/start-stop-daemon.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d212e820..1335216d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-05-15 Guillem Jover + + * utils/start-stop-daemon.c (daemonize): Use _exit instead of exit, to + avoid side effects while the parents terminate. + 2007-05-15 Guillem Jover * utils/start-stop-daemon.c (main): Move daemonizing code to ... diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index b0ad886d..be4885c5 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -264,7 +264,7 @@ daemonize(void) if (pid < 0) fatal("Unable to do first fork.\n"); else if (pid) /* Parent */ - exit(0); + _exit(0); /* Create a new session */ #ifdef HAVE_SETSID @@ -277,7 +277,7 @@ daemonize(void) if (pid < 0) fatal("Unable to do second fork.\n"); else if (pid) /* Parent */ - exit(0); + _exit(0); if (quietmode < 0) printf("done.\n"); -- 2.39.5