Abort gkrellmd detaching if chdir fails
Handle the return value for chdir() and abort daemonizing of gkrellmd in case chdir failed.
This commit is contained in:
parent
cdbeeb9b17
commit
1d11384131
|
@ -1098,7 +1098,12 @@ detach_from_terminal(void)
|
|||
if (fd > 2)
|
||||
close(fd);
|
||||
}
|
||||
chdir("/");
|
||||
|
||||
if (chdir("/") != 0)
|
||||
{
|
||||
g_warning("Detach failed in chdir(\"/\"): %s\n", strerror(errno));
|
||||
return FALSE;
|
||||
}
|
||||
#endif /* HAVE_DAEMON */
|
||||
|
||||
// signal(SIGCHLD, SIG_IGN);
|
||||
|
|
Loading…
Reference in New Issue