dovecot-1.1: Comment updates

dovecot at dovecot.org dovecot at dovecot.org
Thu Apr 24 16:59:23 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/8af71985e97b
changeset: 7456:8af71985e97b
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 24 16:56:10 2008 +0300
description:
Comment updates

diffstat:

1 file changed, 5 insertions(+), 1 deletion(-)
src/lib/file-dotlock.c |    6 +++++-

diffs (24 lines):

diff -r 0dbf10f4493a -r 8af71985e97b src/lib/file-dotlock.c
--- a/src/lib/file-dotlock.c	Thu Apr 24 16:31:07 2008 +0300
+++ b/src/lib/file-dotlock.c	Thu Apr 24 16:56:10 2008 +0300
@@ -236,8 +236,10 @@ static int check_lock(time_t now, struct
 	if (lock_info->have_pid) {
 		/* we've local PID. Check if it exists. */
 		if (kill(pid, 0) == 0 || errno != ESRCH) {
-			if (pid != getpid())
+			if (pid != getpid()) {
+				/* process exists, don't override */
 				return 0;
+			}
 			/* it's us. either we're locking it again, or it's a
 			   stale lock file with same pid than us. either way,
 			   recreate it.. */
@@ -434,6 +436,8 @@ static void dotlock_wait(struct lock_inf
 		usleep(LOCK_RANDOM_USLEEP_TIME);
 		return;
 	}
+	/* timeout after a random time even when using notify, since it
+	   doesn't work reliably with e.g. NFS. */
 	to = timeout_add(LOCK_RANDOM_USLEEP_TIME/1000,
 			 dotlock_wait_end, ioloop);
 	io_loop_run(ioloop);


More information about the dovecot-cvs mailing list