mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-17 16:48:43 +00:00
Detach from the TTY properly.
This commit is contained in:
parent
4b1cf69e76
commit
8411a37e7d
@ -435,6 +435,11 @@ main(int argc, char **argv)
|
|||||||
if (pid)
|
if (pid)
|
||||||
return 0;
|
return 0;
|
||||||
setsid();
|
setsid();
|
||||||
|
close(0);
|
||||||
|
if (open("/dev/null", O_RDWR) < 0)
|
||||||
|
die("Cannot open /dev/null: %m");
|
||||||
|
dup2(0, 1);
|
||||||
|
dup2(0, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
signal_init();
|
signal_init();
|
||||||
|
Loading…
Reference in New Issue
Block a user