diff options
author | Max Kellermann <max@duempel.org> | 2014-01-18 12:01:09 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-18 12:42:30 +0100 |
commit | be47320a0589a84eb942790c3884bb6e25c38a2f (patch) | |
tree | be474aac8c82dfdd9d00b8893a1c4f11caecb6c1 /src/Daemon.hxx | |
parent | 9f3ce7551a481f757feeb6837961f565a686c945 (diff) | |
download | mpd-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/Daemon.hxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Daemon.hxx b/src/Daemon.hxx index d1ce7d0f8..fe5681511 100644 --- a/src/Daemon.hxx +++ b/src/Daemon.hxx @@ -81,11 +81,19 @@ daemonize_set_user(void) #ifndef WIN32 void -daemonize(bool detach); +daemonize_begin(bool detach); #else static inline void -daemonize(bool detach) +daemonize_begin(bool detach) { (void)detach; } #endif +#ifndef WIN32 +void +daemonize_commit(); +#else +static inline void +daemonize_commit() {} +#endif + #endif |