changeset 275:910afdb348ae HEAD

don't silently ignore if expunge can't unlink() some message.
author Timo Sirainen <tss@iki.fi>
date Thu, 19 Sep 2002 22:23:19 +0300
parents ce5b402f6a7a
children 406527c791c7
files src/lib-storage/index/maildir/maildir-expunge.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/maildir/maildir-expunge.c	Thu Sep 19 22:01:12 2002 +0300
+++ b/src/lib-storage/index/maildir/maildir-expunge.c	Thu Sep 19 22:23:19 2002 +0300
@@ -11,18 +11,18 @@
 	const char *fname;
 	char path[1024];
 
-	/* get our file name - ignore if it's missing,
-	   we're deleting it after all.. */
 	fname = ibox->index->lookup_field(ibox->index, rec,
 					  FIELD_TYPE_LOCATION);
 	if (fname != NULL) {
 		i_snprintf(path, sizeof(path), "%s/cur/%s",
 			   ibox->index->dir, fname);
-		if (unlink(path) == -1 && errno != ENOENT) {
+		if (unlink(path) < 0) {
+			/* if it didn't exist, someone just had either
+			   deleted it or changed it's flags */
 			mail_storage_set_error(ibox->box.storage,
 					       "unlink() failed for "
 					       "message file %s: %m", path);
-			/* continue anyway */
+			return FALSE;
 		}
 	}