mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-25 08:06:29 +00:00
new config option, stdout/stdin closed
Now stdin and stdout get closed. Additionally stderr gets closed and reopened to the new config option „logfile“ if specified
This commit is contained in:
10
log.c
10
log.c
@@ -68,7 +68,7 @@ static int detect_log_facility(const char* facility);
|
||||
int log_type = REPMGR_STDERR;
|
||||
int log_level = LOG_NOTICE;
|
||||
|
||||
bool logger_init(const char* ident, const char* level, const char* facility)
|
||||
bool logger_init(t_configuration_options *opts, const char* ident, const char* level, const char* facility)
|
||||
{
|
||||
|
||||
int l;
|
||||
@@ -140,6 +140,14 @@ bool logger_init(const char* ident, const char* level, const char* facility)
|
||||
|
||||
#endif
|
||||
|
||||
fclose(stdin);
|
||||
fclose(stdout);
|
||||
|
||||
if (*opts->logfile)
|
||||
{
|
||||
freopen(opts->logfile, "a", stderr);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user