diff --git a/src/rend-unix.c b/src/rend-unix.c index 73c8dadd..bf212ecd 100644 --- a/src/rend-unix.c +++ b/src/rend-unix.c @@ -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); }