[dovecot-cvs] dovecot/src/deliver deliver.c,1.20.2.5,1.20.2.6
cras at dovecot.org
cras at dovecot.org
Wed Jun 28 23:21:44 EEST 2006
Update of /var/lib/cvs/dovecot/src/deliver
In directory talvi:/tmp/cvs-serv913
Modified Files:
Tag: branch_1_0
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.20.2.5
retrieving revision 1.20.2.6
diff -u -d -r1.20.2.5 -r1.20.2.6
--- deliver.c 27 Jun 2006 10:27:10 -0000 1.20.2.5
+++ deliver.c 28 Jun 2006 20:21:42 -0000 1.20.2.6
@@ -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