[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-storage.c, 1.115.2.15, 1.115.2.16
tss at dovecot.org
tss at dovecot.org
Fri Dec 15 23:08:43 UTC 2006
Update of /var/lib/cvs/dovecot/src/lib-storage/index/maildir
In directory talvi:/tmp/cvs-serv9420/lib-storage/index/maildir
Modified Files:
Tag: branch_1_0
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.115.2.15
retrieving revision 1.115.2.16
diff -u -d -r1.115.2.15 -r1.115.2.16
--- maildir-storage.c 15 Dec 2006 22:52:09 -0000 1.115.2.15
+++ maildir-storage.c 15 Dec 2006 23:08:40 -0000 1.115.2.16
@@ -763,9 +763,7 @@
} else {
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;
@@ -899,8 +897,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->storage,
@@ -966,7 +963,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