The following commit has been merged in the master branch:
commit 1ea1205bd49f68968ebfc52500168255e43ad2e6
Author: Guillem Jover <[email protected]>
Date: Mon Nov 26 21:02:00 2012 +0100
s-s-d: Move setsid() alternative code into a replacement setsid() function
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
index 20a6505..85f3f6a 100644
--- a/utils/start-stop-daemon.c
+++ b/utils/start-stop-daemon.c
@@ -340,6 +340,15 @@ detach_controlling_tty(void)
close(tty_fd);
#endif
}
+
+static pid_t
+setsid(void)
+{
+ setpgid(0, 0);
+ detach_controlling_tty();
+
+ return 0;
+}
#endif
static void
@@ -357,12 +366,7 @@ daemonize(void)
_exit(0);
/* Create a new session. */
-#ifdef HAVE_SETSID
setsid();
-#else
- setpgid(0, 0);
- detach_controlling_tty();
-#endif
pid = fork();
if (pid < 0)
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]