[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-lock.c, 1.25, 1.26 mbox-storage.c, 1.157, 1.158

tss at dovecot.org tss at dovecot.org
Wed Dec 6 15:08:33 UTC 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv32161/lib-storage/index/mbox

Modified Files:
	mbox-lock.c mbox-storage.c 
Log Message:
Lock handling changes. Everything goes through file-lock API now and there's
only a single enum listing the different lock methods. This change exposed
some unneeded (or possibly even wrong?) unlock calls in index file handling
which were fixed.



Index: mbox-lock.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-lock.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- mbox-lock.c	9 Apr 2006 17:27:22 -0000	1.25
+++ mbox-lock.c	6 Dec 2006 15:08:31 -0000	1.26
@@ -23,7 +23,7 @@
 #define DEFAULT_READ_LOCK_METHODS "fcntl"
 #define DEFAULT_WRITE_LOCK_METHODS "dotlock fcntl"
 /* lock timeout */
-#define DEFAULT_LOCK_TIMEOUT (5*60)
+#define MBOX_DEFAULT_LOCK_TIMEOUT (5*60)
 /* assume stale dotlock if mbox file hasn't changed for n seconds */
 #define DEFAULT_DOTLOCK_CHANGE_TIMEOUT (120)
 
@@ -147,7 +147,7 @@
 	}
 
 	str = getenv("MBOX_LOCK_TIMEOUT");
-	lock_timeout = str == NULL ? DEFAULT_LOCK_TIMEOUT : atoi(str);
+	lock_timeout = str == NULL ? MBOX_DEFAULT_LOCK_TIMEOUT : atoi(str);
 
 	str = getenv("MBOX_DOTLOCK_CHANGE_TIMEOUT");
 	dotlock_change_timeout = str == NULL ?

Index: mbox-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-storage.c,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -d -r1.157 -r1.158
--- mbox-storage.c	3 Dec 2006 13:30:03 -0000	1.157
+++ mbox-storage.c	6 Dec 2006 15:08:31 -0000	1.158
@@ -377,7 +377,7 @@
 
 static struct mail_storage *
 mbox_create(const char *data, const char *user, enum mail_storage_flags flags,
-	    enum mail_storage_lock_method lock_method)
+	    enum file_lock_method lock_method)
 {
 	struct mbox_storage *storage;
 	struct index_storage *istorage;
@@ -389,7 +389,7 @@
 	if (mbox_get_list_settings(&list_set, data, flags) < 0)
 		return NULL;
 	list_set.mail_storage_flags = &flags;
-	list_set.mail_storage_lock_method = &lock_method;
+	list_set.lock_method = &lock_method;
 
 	pool = pool_alloconly_create("storage", 512);
 	storage = p_new(pool, struct mbox_storage, 1);



More information about the dovecot-cvs mailing list