mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 22:32:43 -04:00
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
ee83e77448
commit
37c55e8558
1 changed files with 3 additions and 0 deletions
|
|
@ -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 a new issue