From 25321297554890d01fa2fd6828f7faa906cda54a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 13 Jan 2009 21:44:42 +0100 Subject: daemon: don't fork twice to daemonize To detach from the parent process, fork once and make the old process exit. No need to do that twice. --- src/daemon.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/daemon.c') diff --git a/src/daemon.c b/src/daemon.c index 913f06f8..d311c5b7 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -79,14 +79,6 @@ daemonize(Options *options) g_error("problems setsid'ing"); } - fflush(NULL); - pid = fork(); - if (pid > 0) - _exit(EXIT_SUCCESS); - else if (pid < 0) { - g_error("problems fork'ing for daemon!"); - } - g_debug("daemonized!"); } -- cgit v1.2.3