aboutsummaryrefslogtreecommitdiffstats
path: root/src/Main.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-18 12:01:09 +0100
committerMax Kellermann <max@duempel.org>2014-01-18 12:42:30 +0100
commitbe47320a0589a84eb942790c3884bb6e25c38a2f (patch)
treebe474aac8c82dfdd9d00b8893a1c4f11caecb6c1 /src/Main.cxx
parent9f3ce7551a481f757feeb6837961f565a686c945 (diff)
downloadmpd-be47320a0589a84eb942790c3884bb6e25c38a2f.tar.gz
mpd-be47320a0589a84eb942790c3884bb6e25c38a2f.tar.xz
mpd-be47320a0589a84eb942790c3884bb6e25c38a2f.zip
Daemon: fork as early as possible
Keep the parent process around until MPD has finished initializing. This is important for libraries that are allergic to fork(), such as libupnp.
Diffstat (limited to '')
-rw-r--r--src/Main.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index bc5667755..9cbefdc56 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -403,6 +403,7 @@ int mpd_main(int argc, char *argv[])
}
daemonize_set_user();
+ daemonize_begin(options.daemon);
GlobalEvents::Initialize(*main_loop);
GlobalEvents::Register(GlobalEvents::IDLE, idle_event_emitted);
@@ -451,7 +452,7 @@ int mpd_main(int argc, char *argv[])
playlist_list_global_init();
- daemonize(options.daemon);
+ daemonize_commit();
setup_log_output(options.log_stderr);