[dovecot-cvs] dovecot/src/deliver deliver.c,1.22,1.23

cras at dovecot.org cras at dovecot.org
Wed Jun 28 23:21:45 EEST 2006


Update of /var/lib/cvs/dovecot/src/deliver
In directory talvi:/tmp/cvs-serv16225

Modified Files:
	deliver.c 
Log Message:
Allow log_path settings in config file to be empty without trying to use
empty files then.



Index: deliver.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/deliver/deliver.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- deliver.c	27 Jun 2006 10:27:25 -0000	1.22
+++ deliver.c	28 Jun 2006 20:21:43 -0000	1.23
@@ -317,20 +317,22 @@
 
 static void open_logfile(const char *username)
 {
-	const char *prefix;
+	const char *prefix, *log_path;
 
 	prefix = t_strdup_printf("deliver(%s)", username);
-	if (getenv("LOG_PATH") == NULL) {
+	log_path = getenv("LOG_PATH");
+	if (log_path == NULL || *log_path == '\0') {
 		const char *env = getenv("SYSLOG_FACILITY");
 		i_set_failure_syslog(prefix, LOG_NDELAY,
 				     env == NULL ? LOG_MAIL : atoi(env));
 	} else {
 		/* log to file or stderr */
-		i_set_failure_file(getenv("LOG_PATH"), prefix);
+		i_set_failure_file(log_path, prefix);
 	}
 
-	if (getenv("INFO_LOG_PATH") != NULL)
-		i_set_info_file(getenv("INFO_LOG_PATH"));
+	log_path = getenv("INFO_LOG_PATH");
+	if (log_path != NULL && *log_path != '\0')
+		i_set_info_file(log_path);
 
 	i_set_failure_timestamp_format(getenv("LOG_TIMESTAMP"));
 }



More information about the dovecot-cvs mailing list