summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-08-01 06:46:39 +0000
committerMichael Zucci <zucchi@src.gnome.org>2001-08-01 06:46:39 +0000
commit892892df9cb04c0a1aee47e0e11f2205836b1e7b (patch)
treea4637229c36b9eeef22ac6c2abda1b68b1bb8b77
parent4bfb70fbf0b52f95458780658e8e36ab0a3e179e (diff)
downloadevolution-data-server-892892df9cb04c0a1aee47e0e11f2205836b1e7b.tar.gz
If we fail to get the lock, make sure we close our locking fd, and reset
2001-08-01 Not Zed <NotZed@Ximian.com> * providers/local/camel-mbox-folder.c (mbox_lock): If we fail to get the lock, make sure we close our locking fd, and reset it. Fixes the crash part of 5095.
-rw-r--r--camel/ChangeLog4
-rw-r--r--camel/providers/local/camel-mbox-folder.c8
2 files changed, 11 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 3adfa5ad7..cf15b16eb 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,9 @@
2001-08-01 Not Zed <NotZed@Ximian.com>
+ * providers/local/camel-mbox-folder.c (mbox_lock): If we fail to
+ get the lock, make sure we close our locking fd, and reset it.
+ Fixes the crash part of 5095.
+
* providers/imap/camel-imap-folder.c (camel_imap_folder_changed):
Slightly re-arranged filter/change notification logic. If we;re
filtering, freeze the folder till we're finished to smooth the ui
diff --git a/camel/providers/local/camel-mbox-folder.c b/camel/providers/local/camel-mbox-folder.c
index 1bab553ec..ccdce9c61 100644
--- a/camel/providers/local/camel-mbox-folder.c
+++ b/camel/providers/local/camel-mbox-folder.c
@@ -153,7 +153,13 @@ static int mbox_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *e
return -1;
}
- return camel_lock_folder(lf->folder_path, mf->lockfd, type, ex);
+ if (camel_lock_folder(lf->folder_path, mf->lockfd, type, ex) == -1) {
+ close(mf->lockfd);
+ mf->lockfd = -1;
+ return -1;
+ }
+
+ return 0;
}
static void mbox_unlock(CamelLocalFolder *lf)