Commit 42415592 authored by Max Kellermann's avatar Max Kellermann

daemon: print fork error message

Print details on why the fork() fails.
parent fd8c63b6
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment