From b36dbf61fe6ae1da6d22640bfa985c06ee077036 Mon Sep 17 00:00:00 2001 From: Christian Kruse Date: Tue, 21 Jan 2014 15:31:38 +0100 Subject: [PATCH] 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 --- repmgrd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repmgrd.c b/repmgrd.c index df590f32..6858996c 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -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)