[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-storage.c, 1.138, 1.139
tss at dovecot.org
tss at dovecot.org
Fri Dec 15 23:08:45 UTC 2006
Update of /var/lib/cvs/dovecot/src/lib-storage/index/maildir
In directory talvi:/tmp/cvs-serv9416/lib-storage/index/maildir
Modified Files:
maildir-storage.c
Log Message:
Added EDESTDIREXISTS() macro, and changed rename() calls to use it.
Index: maildir-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-storage.c,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -d -r1.138 -r1.139
--- maildir-storage.c 15 Dec 2006 22:52:11 -0000 1.138
+++ maildir-storage.c 15 Dec 2006 23:08:43 -0000 1.139
@@ -661,9 +661,7 @@
mailbox listing sees it. */
count = 0;
while (rename(src, dest) < 0 && count < 2) {
- /* EBUSY is given by some NFS implementations */
- if (errno != EEXIST && errno != ENOTEMPTY &&
- errno != EBUSY) {
+ if (!EDESTDIREXISTS(errno)) {
mail_storage_set_critical(_storage,
"rename(%s, %s) failed: %m", src, dest);
return -1;
@@ -771,8 +769,7 @@
Anyway, the bug with merging is that if both folders have
identically named subfolder they conflict. Just ignore those
and leave them under the old folder. */
- if (rename(oldpath, newpath) == 0 ||
- errno == EEXIST || errno == ENOTEMPTY)
+ if (rename(oldpath, newpath) == 0 || EDESTDIREXISTS(errno))
ret = 1;
else {
mail_storage_set_critical(storage,
@@ -842,7 +839,7 @@
return 0;
}
- if (errno == EEXIST) {
+ if (EDESTDIREXISTS(errno)) {
mail_storage_set_error(_storage,
"Target mailbox already exists");
return -1;
More information about the dovecot-cvs
mailing list