reopening stdin and stdout to /dev/null now

stdin, stdout and stderr should always be valid file handles. Thus we
don't close them but reopen them to /dev/null
This commit is contained in:
Christian Kruse
2014-01-21 15:31:38 +01:00
parent 84466ecca5
commit b36dbf61fe

View File

@@ -274,8 +274,8 @@ main(int argc, char **argv)
terminate(ERR_BAD_CONFIG);
}
fclose(stdin);
fclose(stdout);
freopen("/dev/null", "r", stdin);
freopen("/dev/null", "w", stdout);
logger_init(&local_options, progname, local_options.loglevel, local_options.logfacility);
if (verbose)