Mercurial > dovecot > core-2.2
changeset 4308:b0c4e02d715b HEAD
If dotlock creation timeouts, unlink() the temp file we used
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 08 Jun 2006 19:42:40 +0300 |
parents | f92485c7bbd7 |
children | eb8f869a1126 |
files | src/lib/file-dotlock.c |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/file-dotlock.c Thu Jun 08 19:41:30 2006 +0300 +++ b/src/lib/file-dotlock.c Thu Jun 08 19:42:40 2006 +0300 @@ -324,7 +324,7 @@ return -1; } - if (unlink(lock_info->temp_path) < 0 && errno != ENOENT) { + if (unlink(lock_info->temp_path) < 0) { i_error("unlink(%s) failed: %m", lock_info->temp_path); /* non-fatal, continue */ } @@ -459,6 +459,10 @@ i_error("close(%s) failed: %m", lock_path); errno = old_errno; } + if (lock_info.temp_path != NULL) { + if (unlink(lock_info.temp_path) < 0) + i_error("unlink(%s) failed: %m", lock_info.temp_path); + } if (ret == 0) errno = EAGAIN;