From 0ff44374fd277fe0663550bf7dc8348680bd5731 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 1 Aug 2001 06:46:39 +0000 Subject: If we fail to get the lock, make sure we close our locking fd, and reset 2001-08-01 Not Zed * 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. svn path=/trunk/; revision=11538 --- camel/ChangeLog | 4 ++++ camel/providers/local/camel-mbox-folder.c | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index 3adfa5ad7c..cf15b16eb5 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,9 @@ 2001-08-01 Not Zed + * 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 1bab553ecf..ccdce9c61e 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) -- cgit v1.2.3