mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 00:46:29 +00:00
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:
3
log.c
3
log.c
@@ -140,9 +140,6 @@ bool logger_init(t_configuration_options *opts, const char* ident, const char* l
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fclose(stdin);
|
|
||||||
fclose(stdout);
|
|
||||||
|
|
||||||
if (*opts->logfile)
|
if (*opts->logfile)
|
||||||
{
|
{
|
||||||
freopen(opts->logfile, "a", stderr);
|
freopen(opts->logfile, "a", stderr);
|
||||||
|
|||||||
@@ -272,6 +272,9 @@ main(int argc, char **argv)
|
|||||||
exit(ERR_BAD_CONFIG);
|
exit(ERR_BAD_CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fclose(stdin);
|
||||||
|
fclose(stdout);
|
||||||
|
|
||||||
logger_init(&local_options, progname, local_options.loglevel, local_options.logfacility);
|
logger_init(&local_options, progname, local_options.loglevel, local_options.logfacility);
|
||||||
if (verbose)
|
if (verbose)
|
||||||
logger_min_verbose(LOG_INFO);
|
logger_min_verbose(LOG_INFO);
|
||||||
|
|||||||
Reference in New Issue
Block a user