From be47320a0589a84eb942790c3884bb6e25c38a2f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 18 Jan 2014 12:01:09 +0100 Subject: 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. --- src/Daemon.hxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/Daemon.hxx') 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 -- cgit v1.2.3