Detach from the TTY properly.
This commit is contained in:
parent
4b1cf69e76
commit
8411a37e7d
1 changed files with 5 additions and 0 deletions
|
@ -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 a new issue