Commit 8411a37e authored by Martin Mareš's avatar Martin Mareš

Detach from the TTY properly.

parent 4b1cf69e
......@@ -435,6 +435,11 @@ main(int argc, char **argv)
if (pid)
return 0;
setsid();
close(0);
if (open("/dev/null", O_RDWR) < 0)
die("Cannot open /dev/null: %m");
dup2(0, 1);
dup2(0, 2);
}
signal_init();
......
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