aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/mail-mt.c11
2 files changed, 14 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index f4745073ea..3521f4d313 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,9 @@
+2001-10-23 Dan Winship <danw@ximian.com>
+
+ * mail-mt.c (mail_msg_new): If the fopen() fails (eg, because
+ evolution-mail was started by oafd with PWD=/), don't try to use
+ the NULL file handle.
+
2001-10-23 <NotZed@Ximian.com>
* mail-session.c (get_password): Completely re-done. We now hae a
diff --git a/mail/mail-mt.c b/mail/mail-mt.c
index ab240d595f..af3eb5c5f2 100644
--- a/mail/mail-mt.c
+++ b/mail/mail-mt.c
@@ -95,8 +95,14 @@ void *mail_msg_new(mail_msg_op_t *ops, EMsgPort *reply_port, size_t size)
log_ops = getenv("EVOLUTION_MAIL_LOG_OPS") != NULL;
log_locks = getenv("EVOLUTION_MAIL_LOG_LOCKS") != NULL;
log = fopen("evolution-mail-ops.log", "w+");
- setvbuf(log, NULL, _IOLBF, 0);
- fprintf(log, "Started evolution-mail: %s\n", ctime(&now));
+ if (log) {
+ setvbuf(log, NULL, _IOLBF, 0);
+ fprintf(log, "Started evolution-mail: %s\n", ctime(&now));
+ g_warning("Logging mail operations to evolution-mail-ops.log");
+ } else {
+ g_warning ("Could not open log file: %s", g_strerror (errno));
+ log_ops = log_locks = FALSE;
+ }
#ifdef LOG_OPS
if (log_ops)
fprintf(log, "Logging async operations\n");
@@ -107,7 +113,6 @@ void *mail_msg_new(mail_msg_op_t *ops, EMsgPort *reply_port, size_t size)
fprintf(log, "%ld: lock mail_msg_lock\n", pthread_self());
}
#endif
- g_warning("Logging mail operations to evolution-mail-ops.log");
}
#endif
msg = g_malloc0(size);