diff options
author | Max Kellermann <max@duempel.org> | 2009-02-15 16:27:50 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-02-15 16:27:50 +0100 |
commit | 42415592b4368d1dc6fb2c8446da32318fd06d44 (patch) | |
tree | e67f7fdde393c30bf67e292dda0295d27f71af58 | |
parent | fd8c63b619552f379353e9d6c430cda1164aafc4 (diff) | |
download | mpd-42415592b4368d1dc6fb2c8446da32318fd06d44.tar.gz mpd-42415592b4368d1dc6fb2c8446da32318fd06d44.tar.xz mpd-42415592b4368d1dc6fb2c8446da32318fd06d44.zip |
daemon: print fork error message
Print details on why the fork() fails.
-rw-r--r-- | src/daemon.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/daemon.c b/src/daemon.c index bb2b8ded1..3cf81911e 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -134,10 +134,11 @@ daemonize_detach(void) fflush(NULL); pid = fork(); + if (pid < 0) + g_error("fork() failed: %s", g_strerror(errno)); + if (pid > 0) _exit(EXIT_SUCCESS); - else if (pid < 0) - g_error("problems fork'ing for daemon!"); if (chdir("/") < 0) g_error("problems changing to root directory"); |