aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-13 21:44:42 +0100
committerMax Kellermann <max@duempel.org>2009-01-13 21:44:42 +0100
commit25321297554890d01fa2fd6828f7faa906cda54a (patch)
treee8c6537b82154c8410f9760ec77225dfb2ec8d9d
parentd8fc8ca7bac8f378c4ff7bbc02f22a37ac72a792 (diff)
downloadmpd-25321297554890d01fa2fd6828f7faa906cda54a.tar.gz
mpd-25321297554890d01fa2fd6828f7faa906cda54a.tar.xz
mpd-25321297554890d01fa2fd6828f7faa906cda54a.zip
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.
-rw-r--r--src/daemon.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/daemon.c b/src/daemon.c
index 913f06f89..d311c5b7c 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!");
}