dovecot-2.1: lib-lda: Give a better error message if dotlocking ...

dovecot at dovecot.org dovecot at dovecot.org
Fri Feb 22 12:19:46 EET 2013


details:   http://hg.dovecot.org/dovecot-2.1/rev/81ea622b6394
changeset: 14918:81ea622b6394
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Feb 22 12:19:36 2013 +0200
description:
lib-lda: Give a better error message if dotlocking duplicate db fails.

diffstat:

 src/lib-lda/duplicate.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r 0e0fd4b5a582 -r 81ea622b6394 src/lib-lda/duplicate.c
--- a/src/lib-lda/duplicate.c	Fri Feb 22 12:12:26 2013 +0200
+++ b/src/lib-lda/duplicate.c	Fri Feb 22 12:19:36 2013 +0200
@@ -212,8 +212,14 @@
 	file->path = p_strdup(pool, ctx->path);
 	file->new_fd = file_dotlock_open(&ctx->dotlock_set, file->path, 0,
 					 &file->dotlock);
-	if (file->new_fd == -1)
-		i_error("file_dotlock_create(%s) failed: %m", file->path);
+	if (file->new_fd != -1)
+		;
+	else if (errno != EAGAIN)
+		i_error("file_dotlock_open(%s) failed: %m", file->path);
+	else {
+		i_error("Creating lock file for %s timed out in %u secs",
+			file->path, ctx->dotlock_set.timeout);
+	}
 	file->hash = hash_table_create(default_pool, pool, 0,
 				       duplicate_hash, duplicate_cmp);
 	(void)duplicate_read(file);


More information about the dovecot-cvs mailing list