Browse Source

* utils/start-stop-daemon.c (daemonize): Use _exit instead of exit, to
avoid side effects while the parents terminate.

Guillem Jover 17 years ago
parent
commit
57542dd67a
2 changed files with 7 additions and 2 deletions
  1. 5 0
      ChangeLog
  2. 2 2
      utils/start-stop-daemon.c

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2007-05-15  Guillem Jover  <guillem@debian.org>
+
+	* utils/start-stop-daemon.c (daemonize): Use _exit instead of exit, to
+	avoid side effects while the parents terminate.
+
 2007-05-15  Guillem Jover  <guillem@debian.org>
 
 	* utils/start-stop-daemon.c (main): Move daemonizing code to ...

+ 2 - 2
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");