dovecot-2.0: master: Don't close stderr if logging goes there.

dovecot at dovecot.org dovecot at dovecot.org
Wed Mar 16 19:49:29 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/26d5351649ac
changeset: 12688:26d5351649ac
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Mar 16 19:49:27 2011 +0200
description:
master: Don't close stderr if logging goes there.

diffstat:

 src/master/main.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r be0f0de75e34 -r 26d5351649ac src/master/main.c
--- a/src/master/main.c	Wed Mar 16 19:17:57 2011 +0200
+++ b/src/master/main.c	Wed Mar 16 19:49:27 2011 +0200
@@ -774,8 +774,12 @@
 	if (chdir(set->base_dir) < 0)
 		i_fatal("chdir(%s) failed: %m", set->base_dir);
 
-	if (dup2(null_fd, STDERR_FILENO) < 0)
-		i_fatal("dup2(null_fd) failed: %m");
+	if (strcmp(services->service_set->log_path, "/dev/stderr") != 0 &&
+	    strcmp(services->service_set->info_log_path, "/dev/stderr") != 0 &&
+	    strcmp(services->service_set->debug_log_path, "/dev/stderr") != 0) {
+		if (dup2(null_fd, STDERR_FILENO) < 0)
+			i_fatal("dup2(null_fd) failed: %m");
+	}
 	i_set_fatal_handler(master_fatal_callback);
 	i_set_error_handler(orig_error_callback);
 


More information about the dovecot-cvs mailing list