aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-mt.c
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/mail-mt.c
parent41fb38eb09e338d76e63cb8b6a2ac7e2505e5c72 (diff)
downloadgsoc2013-evolution-1651eba931c6cc80e9a5bd24dcbb591ae9e1163b.tar.gz
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/mail-mt.c')
-rw-r--r--mail/mail-mt.c37
1 files changed, 19 insertions, 18 deletions
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);