diff options
author | Max Kellermann <max@duempel.org> | 2009-01-13 21:44:42 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-13 21:44:42 +0100 |
commit | 25321297554890d01fa2fd6828f7faa906cda54a (patch) | |
tree | e8c6537b82154c8410f9760ec77225dfb2ec8d9d | |
parent | d8fc8ca7bac8f378c4ff7bbc02f22a37ac72a792 (diff) | |
download | mpd-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.
Diffstat (limited to '')
-rw-r--r-- | src/daemon.c | 8 |
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!"); } |