Mercurial > dovecot > original-hg > dovecot-1.2
changeset 6772:b78cfc60f6a1 HEAD
Added missing error logging for file_dotlock_create/open calls.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 11 Nov 2007 16:49:37 +0200 |
parents | fd9effba151d |
children | b2b1da3f85b4 |
files | src/deliver/duplicate.c src/lib-index/mail-cache.c src/lib-index/mail-hash.c src/plugins/convert/convert-storage.c |
diffstat | 4 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/deliver/duplicate.c Sun Nov 11 16:02:25 2007 +0200 +++ b/src/deliver/duplicate.c Sun Nov 11 16:49:37 2007 +0200 @@ -210,6 +210,8 @@ file->path = p_strdup(pool, path); file->new_fd = file_dotlock_open(&duplicate_dotlock_set, path, 0, &file->dotlock); + if (file->new_fd == -1) + i_error("file_dotlock_create(%s) failed: %m", path); file->hash = hash_create(default_pool, pool, 0, duplicate_hash, duplicate_cmp); (void)duplicate_read(file);
--- a/src/lib-index/mail-cache.c Sun Nov 11 16:02:25 2007 +0200 +++ b/src/lib-index/mail-cache.c Sun Nov 11 16:49:37 2007 +0200 @@ -472,6 +472,10 @@ i_assert(cache->dotlock == NULL); ret = file_dotlock_create(&cache->dotlock_settings, cache->filepath, 0, &cache->dotlock); + if (ret < 0) { + mail_cache_set_syscall_error(cache, + "file_dotlock_create()"); + } } if (ret <= 0)
--- a/src/lib-index/mail-hash.c Sun Nov 11 16:02:25 2007 +0200 +++ b/src/lib-index/mail-hash.c Sun Nov 11 16:49:37 2007 +0200 @@ -417,8 +417,13 @@ &hash->file_lock); } else { i_assert(hash->dotlock == NULL); - return file_dotlock_create(&hash->dotlock_settings, - hash->filepath, 0, &hash->dotlock); + if (file_dotlock_create(&hash->dotlock_settings, + hash->filepath, 0, + &hash->dotlock) < 0) { + mail_hash_set_syscall_error(hash, "open()"); + return -1; + } + return 0; } }
--- a/src/plugins/convert/convert-storage.c Sun Nov 11 16:02:25 2007 +0200 +++ b/src/plugins/convert/convert-storage.c Sun Nov 11 16:49:37 2007 +0200 @@ -403,6 +403,8 @@ if (ret <= 0) { if (ret == 0) i_error("Mailbox conversion: Lock creation timeouted"); + else + i_error("file_dotlock_create(%s) failed: %m", path); return -1; }