[dovecot-cvs] dovecot/src/lib file-dotlock.c,1.7,1.8

cras at procontrol.fi cras at procontrol.fi
Mon Oct 20 05:50:20 EEST 2003


Update of /home/cvs/dovecot/src/lib
In directory danu:/tmp/cvs-serv2085/lib

Modified Files:
	file-dotlock.c 
Log Message:
save errno in failures



Index: file-dotlock.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/file-dotlock.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- file-dotlock.c	15 Jul 2003 18:41:01 -0000	1.7
+++ file-dotlock.c	20 Oct 2003 01:50:18 -0000	1.8
@@ -298,9 +298,12 @@
 		now = time(NULL);
 	} while (now < max_wait_time);
 
-	if (ret <= 0) {
+	if (ret <= 0 && lock_info.fd != -1) {
+		int old_errno = errno;
+
 		(void)close(lock_info.fd);
 		lock_info.fd = -1;
+		errno = old_errno;
 	}
 	*fd = lock_info.fd;
 



More information about the dovecot-cvs mailing list