If we fail to get the lock, make sure we close our locking fd, and reset
authorNot Zed <NotZed@Ximian.com>
Wed, 1 Aug 2001 06:46:39 +0000 (06:46 +0000)
committerMichael Zucci <zucchi@src.gnome.org>
Wed, 1 Aug 2001 06:46:39 +0000 (06:46 +0000)
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.

camel/ChangeLog
camel/providers/local/camel-mbox-folder.c

index 3adfa5a..cf15b16 100644 (file)
@@ -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
index 1bab553..ccdce9c 100644 (file)
@@ -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)