Detach from controlling session of parent. This is similar
to what is done in daemon(3), which we can not use directly in this context. Reviewed by: pjd MFC after: 2 weeks
This commit is contained in:
parent
2c5d789700
commit
727357321c
@ -63,6 +63,9 @@ stdnull(void)
|
||||
if (fd == -1)
|
||||
errx(1, "Unable to open %s", _PATH_DEVNULL);
|
||||
|
||||
if (setsid() == -1)
|
||||
errx(1, "Unable to detach from session");
|
||||
|
||||
if (dup2(fd, STDIN_FILENO) == -1)
|
||||
errx(1, "Unable to cover stdin");
|
||||
if (dup2(fd, STDOUT_FILENO) == -1)
|
||||
|
Loading…
Reference in New Issue
Block a user