[dovecot-cvs] dovecot/src/lib file-dotlock.c,1.35,1.35.2.1

cras at dovecot.org cras at dovecot.org
Wed May 10 14:24:22 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv13037

Modified Files:
      Tag: branch_1_0
	file-dotlock.c 
Log Message:
If dotlock creation timeouts, unlink() the temp file we used



Index: file-dotlock.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/file-dotlock.c,v
retrieving revision 1.35
retrieving revision 1.35.2.1
diff -u -d -r1.35 -r1.35.2.1
--- file-dotlock.c	20 Apr 2006 19:50:45 -0000	1.35
+++ file-dotlock.c	10 May 2006 11:24:20 -0000	1.35.2.1
@@ -320,7 +320,7 @@
 		return -1;
 	}
 
-	if (unlink(lock_info->temp_path) < 0 && errno != ENOENT) {
+	if (unlink(lock_info->temp_path) < 0) {
 		i_error("unlink(%s) failed: %m", lock_info->temp_path);
 		/* non-fatal, continue */
 	}
@@ -456,6 +456,10 @@
 			i_error("close(%s) failed: %m", lock_path);
 		errno = old_errno;
 	}
+	if (lock_info.temp_path != NULL) {
+		if (unlink(lock_info.temp_path) < 0)
+			i_error("unlink(%s) failed: %m", lock_info.temp_path);
+	}
 
 	if (ret == 0)
 		errno = EAGAIN;



More information about the dovecot-cvs mailing list