fix: close stdin and stdout only in repmgrd

closing stdin and stdout might cause problems when using system(), so we
avoid it.
This commit is contained in:
Christian Kruse
2014-01-16 16:01:58 +01:00
parent 9563877fbb
commit a08aa50f92
2 changed files with 3 additions and 3 deletions

3
log.c
View File

@@ -140,9 +140,6 @@ bool logger_init(t_configuration_options *opts, const char* ident, const char* l
#endif
fclose(stdin);
fclose(stdout);
if (*opts->logfile)
{
freopen(opts->logfile, "a", stderr);

View File

@@ -272,6 +272,9 @@ main(int argc, char **argv)
exit(ERR_BAD_CONFIG);
}
fclose(stdin);
fclose(stdout);
logger_init(&local_options, progname, local_options.loglevel, local_options.logfacility);
if (verbose)
logger_min_verbose(LOG_INFO);