aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-10-24 00:32:44 +0800
committerDan Winship <danw@src.gnome.org>2001-10-24 00:32:44 +0800
commit41fb38eb09e338d76e63cb8b6a2ac7e2505e5c72 (patch)
treec7810ff943542303095b313f694a8885e4f797a0 /mail
parent66efbe69a2d8be17f17f899a0ddd7342cf22ee4b (diff)
downloadgsoc2013-evolution-41fb38eb09e338d76e63cb8b6a2ac7e2505e5c72.tar
gsoc2013-evolution-41fb38eb09e338d76e63cb8b6a2ac7e2505e5c72.tar.gz
gsoc2013-evolution-41fb38eb09e338d76e63cb8b6a2ac7e2505e5c72.tar.bz2
gsoc2013-evolution-41fb38eb09e338d76e63cb8b6a2ac7e2505e5c72.tar.lz
gsoc2013-evolution-41fb38eb09e338d76e63cb8b6a2ac7e2505e5c72.tar.xz
gsoc2013-evolution-41fb38eb09e338d76e63cb8b6a2ac7e2505e5c72.tar.zst
gsoc2013-evolution-41fb38eb09e338d76e63cb8b6a2ac7e2505e5c72.zip
If the fopen() fails (eg, because evolution-mail was started by oafd with
* 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. svn path=/trunk/; revision=13943
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);