Mercurial > dovecot > original-hg > dovecot-1.2
changeset 6066:bba5f170a565 HEAD
Handle multiple simultaneous DELETEs better.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 18 Jul 2007 06:49:22 +0300 |
parents | 16698620809a |
children | f5d87227d12c |
files | src/lib-storage/index/maildir/maildir-storage.c |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/maildir/maildir-storage.c Wed Jul 18 06:42:17 2007 +0300 +++ b/src/lib-storage/index/maildir/maildir-storage.c Wed Jul 18 06:49:22 2007 +0300 @@ -774,7 +774,7 @@ ..DOVECOT-TRASH directory, it gets deleted the next time mailbox listing sees it. */ count = 0; - while (rename(src, dest) < 0 && count < 2) { + while (rename(src, dest) < 0) { if (errno == ENOENT) { /* it was just deleted under us by another process */ @@ -789,7 +789,8 @@ } /* already existed, delete it and try again */ - if (unlink_directory(dest, TRUE) < 0) { + if (unlink_directory(dest, TRUE) < 0 && + (errno != ENOTEMPTY || count >= 5)) { mailbox_list_set_critical(list, "unlink_directory(%s) failed: %m", dest); return -1;