From 2a43c6f0971268606247de7b41af65d4c4123a2f Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 22 Feb 2013 12:19:36 +0200 Subject: [PATCH] lib-lda: Give a better error message if dotlocking duplicate db fails. --- src/lib-lda/duplicate.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib-lda/duplicate.c b/src/lib-lda/duplicate.c index f504673486..a982b93e01 100644 --- a/src/lib-lda/duplicate.c +++ b/src/lib-lda/duplicate.c @@ -212,8 +212,14 @@ static struct duplicate_file *duplicate_file_new(struct duplicate_context *ctx) 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); -- 2.47.3