[dovecot-cvs] dovecot/src/lib-storage/subscription-file subscription-file.c,1.8,1.9

cras at procontrol.fi cras at procontrol.fi
Mon Nov 25 21:02:52 EET 2002


Update of /home/cvs/dovecot/src/lib-storage/subscription-file
In directory danu:/tmp/cvs-serv2991/src/lib-storage/subscription-file

Modified Files:
	subscription-file.c 
Log Message:
Locking changes triggered a bit larger cleanup :) If we have to wait for a
lock longer, the client is now notified about it every 30 seconds. Also if
mailbox opening fails because of lock timeout, we won't overwrite the index
anymore. Finally user gets a clear error message about lock timeout instead
of "internal error".



Index: subscription-file.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/subscription-file/subscription-file.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- subscription-file.c	23 Oct 2002 20:41:35 -0000	1.8
+++ subscription-file.c	25 Nov 2002 19:02:50 -0000	1.9
@@ -42,8 +42,9 @@
 		return -1;
 	}
 
-	if (file_wait_lock(fd, update ? F_WRLCK : F_RDLCK,
-			   DEFAULT_LOCK_TIMEOUT) <= 0) {
+	/* FIXME: we should work without locking, rename() would be easiest
+	   but .lock would work too */
+	if (file_wait_lock(fd, update ? F_WRLCK : F_RDLCK) <= 0) {
 		subsfile_set_syscall_error(storage, "file_wait_lock()", *path);
 		(void)close(fd);
 		return -1;




More information about the dovecot-cvs mailing list