comparison src/lib-storage/index/maildir/maildir-sync.c @ 8772:dfcb8a6a4f5f HEAD

maildir: We didn't properly handle missing control directory at startup. Also some other error handling when some dirs were missing were done wrong.
author Timo Sirainen <tss@iki.fi>
date Mon, 23 Feb 2009 13:40:01 -0500
parents b9faf4db2a9f
children 43a49b3d3b5e
comparison
equal deleted inserted replaced
8771:8b6dd6d0f33a 8772:dfcb8a6a4f5f
342 if (nfs_safe_stat(path, st_r) == 0) 342 if (nfs_safe_stat(path, st_r) == 0)
343 return 0; 343 return 0;
344 if (errno != ENOENT || i == MAILDIR_DELETE_RETRY_COUNT) 344 if (errno != ENOENT || i == MAILDIR_DELETE_RETRY_COUNT)
345 break; 345 break;
346 346
347 if (maildir_set_deleted(mbox)) 347 if (!maildir_set_deleted(mbox))
348 return -1; 348 return -1;
349 /* try again */ 349 /* try again */
350 } 350 }
351 351
352 mail_storage_set_critical(mbox->ibox.box.storage, 352 mail_storage_set_critical(mbox->ibox.box.storage,
378 mail_storage_set_critical(storage, 378 mail_storage_set_critical(storage,
379 "opendir(%s) failed: %m", path); 379 "opendir(%s) failed: %m", path);
380 return -1; 380 return -1;
381 } 381 }
382 382
383 if (maildir_set_deleted(ctx->mbox)) 383 if (!maildir_set_deleted(ctx->mbox))
384 return -1; 384 return -1;
385 /* try again */ 385 /* try again */
386 } 386 }
387 387
388 #ifdef HAVE_DIRFD 388 #ifdef HAVE_DIRFD