aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
author3 <NotZed@Ximian.com>2001-10-24 01:11:33 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-24 01:11:33 +0800
commit1651eba931c6cc80e9a5bd24dcbb591ae9e1163b (patch)
tree8c705ac59212e2ed4d531eb5a1cb8272240595ac /mail
parent41fb38eb09e338d76e63cb8b6a2ac7e2505e5c72 (diff)
downloadgsoc2013-evolution-1651eba931c6cc80e9a5bd24dcbb591ae9e1163b.tar
gsoc2013-evolution-1651eba931c6cc80e9a5bd24dcbb591ae9e1163b.tar.gz
gsoc2013-evolution-1651eba931c6cc80e9a5bd24dcbb591ae9e1163b.tar.bz2
gsoc2013-evolution-1651eba931c6cc80e9a5bd24dcbb591ae9e1163b.tar.lz
gsoc2013-evolution-1651eba931c6cc80e9a5bd24dcbb591ae9e1163b.tar.xz
gsoc2013-evolution-1651eba931c6cc80e9a5bd24dcbb591ae9e1163b.tar.zst
gsoc2013-evolution-1651eba931c6cc80e9a5bd24dcbb591ae9e1163b.zip
Added missing errno.h (mail_msg_new): Fix the logic a bit, dont try to
2001-10-23 <NotZed@Ximian.com> * mail-mt.c: Added missing errno.h (mail_msg_new): Fix the logic a bit, dont try to open the log file unless logging is actually requested. svn path=/trunk/; revision=13944
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/mail-mt.c37
2 files changed, 25 insertions, 18 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 3521f4d313..1cc274500b 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,9 @@
+2001-10-23 <NotZed@Ximian.com>
+
+ * mail-mt.c: Added missing errno.h
+ (mail_msg_new): Fix the logic a bit, dont try to open the log file
+ unless logging is actually requested.
+
2001-10-23 Dan Winship <danw@ximian.com>
* mail-mt.c (mail_msg_new): If the fopen() fails (eg, because
diff --git a/mail/mail-mt.c b/mail/mail-mt.c
index af3eb5c5f2..3f45617b84 100644
--- a/mail/mail-mt.c
+++ b/mail/mail-mt.c
@@ -5,6 +5,7 @@
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
+#include <errno.h>
#include <glib.h>
@@ -94,25 +95,25 @@ void *mail_msg_new(mail_msg_op_t *ops, EMsgPort *reply_port, size_t size)
log_init = TRUE;
log_ops = getenv("EVOLUTION_MAIL_LOG_OPS") != NULL;
log_locks = getenv("EVOLUTION_MAIL_LOG_LOCKS") != NULL;
- log = fopen("evolution-mail-ops.log", "w+");
- 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");
-#endif
-#ifdef LOG_LOCKS
- if (log_locks) {
- fprintf(log, "Logging lock operations, mail_gui_thread = %ld\n\n", mail_gui_thread);
- fprintf(log, "%ld: lock mail_msg_lock\n", pthread_self());
+ if (log_ops || log_locks) {
+ log = fopen("evolution-mail-ops.log", "w+");
+ 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");
+
+ if (log_ops)
+ fprintf(log, "Logging async operations\n");
+
+ if (log_locks) {
+ fprintf(log, "Logging lock operations, mail_gui_thread = %ld\n\n", mail_gui_thread);
+ fprintf(log, "%ld: lock mail_msg_lock\n", pthread_self());
+ }
+ } else {
+ g_warning ("Could not open log file: %s", strerror(errno));
+ log_ops = log_locks = FALSE;
+ }
}
-#endif
}
#endif
msg = g_malloc0(size);