Close stdin, stdout and stderr only if demonizing. Fixes verbose mode.

This commit is contained in:
ValdikSS
2017-04-12 19:57:57 +03:00
parent 83a04ad79d
commit b2de5bdb02

2
net.c
View File

@@ -238,9 +238,11 @@ int start_listener (char *inip, char *inpt, char *srcip, char *dstip,
return 1;
}
if (dm) {
close(STDIN_FILENO);
close(STDOUT_FILENO);
close(STDERR_FILENO);
}
main_loop(listen, listen_h, bind_h, dst_h);