daemon: print fork error message
Print details on why the fork() fails.
This commit is contained in:
parent
fd8c63b619
commit
42415592b4
@ -134,10 +134,11 @@ daemonize_detach(void)
|
|||||||
fflush(NULL);
|
fflush(NULL);
|
||||||
|
|
||||||
pid = fork();
|
pid = fork();
|
||||||
|
if (pid < 0)
|
||||||
|
g_error("fork() failed: %s", g_strerror(errno));
|
||||||
|
|
||||||
if (pid > 0)
|
if (pid > 0)
|
||||||
_exit(EXIT_SUCCESS);
|
_exit(EXIT_SUCCESS);
|
||||||
else if (pid < 0)
|
|
||||||
g_error("problems fork'ing for daemon!");
|
|
||||||
|
|
||||||
if (chdir("/") < 0)
|
if (chdir("/") < 0)
|
||||||
g_error("problems changing to root directory");
|
g_error("problems changing to root directory");
|
||||||
|
Loading…
Reference in New Issue
Block a user