Commit 833549ed authored by Maxim Zakharov's avatar Maxim Zakharov Committed by Rusty Russell

daemonize: check setsid() return value

parent 40b6a6ed
......@@ -33,7 +33,8 @@ bool daemonize(void)
close(0);
/* Session leader so ^C doesn't whack us. */
setsid();
if (setsid() == (pid_t)-1)
return false;
/* Move off any mount points we might be in. */
if (chdir("/") != 0)
return false;
......
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