dovecot: If fcntl() or flock() fails, log the lock_type.

dovecot at dovecot.org dovecot at dovecot.org
Mon Feb 4 21:25:58 EET 2008


details:   http://hg.dovecot.org/dovecot/rev/45bfc162a43c
changeset: 7213:45bfc162a43c
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Feb 04 19:12:46 2008 +0200
description:
If fcntl() or flock() fails, log the lock_type.

diffstat:

1 file changed, 8 insertions(+), 2 deletions(-)
src/lib/file-lock.c |   10 ++++++++--

diffs (27 lines):

diff -r 2ed72512334b -r 45bfc162a43c src/lib/file-lock.c
--- a/src/lib/file-lock.c	Mon Feb 04 18:53:34 2008 +0200
+++ b/src/lib/file-lock.c	Mon Feb 04 19:12:46 2008 +0200
@@ -64,7 +64,10 @@ static int file_lock_do(int fd, const ch
 			errno = EAGAIN;
 			return 0;
 		}
-		i_error("fcntl() locking failed for file %s: %m", path);
+		i_error("fcntl(%s) locking failed for file %s: %m",
+			lock_type == F_UNLCK ? "unlock" :
+			lock_type == F_RDLCK ? "read-lock" : "write-lock",
+			path);
 		return -1;
 #endif
 	}
@@ -97,7 +100,10 @@ static int file_lock_do(int fd, const ch
 			   b) timeouted */
 			return 0;
 		}
-		i_error("flock() locking failed for file %s: %m", path);
+		i_error("flock(%s) locking failed for file %s: %m",
+			lock_type == F_UNLCK ? "unlock" :
+			lock_type == F_RDLCK ? "read-lock" : "write-lock",
+			path);
 		return -1;
 #endif
 	}


More information about the dovecot-cvs mailing list