aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/local/camel-mbox-folder.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers/local/camel-mbox-folder.c')
-rw-r--r--camel/providers/local/camel-mbox-folder.c8
1 files changed, 7 insertions, 1 deletions
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)