close STDERR on fork

This commit is contained in:
Ron Pedde 2006-03-05 02:01:22 +00:00
parent 97fea2ff84
commit 58236d00c1

View File

@ -108,7 +108,9 @@ int rend_init(char *user) {
if((fd = open("/dev/null", O_RDWR, 0)) != -1) {
dup2(fd, STDIN_FILENO);
dup2(fd, STDOUT_FILENO);
// dup2(fd, STDERR_FILENO);
if(!config.foreground)
dup2(fd, STDERR_FILENO);
if (fd > 2)
close(fd);
}