From: Timo Sirainen Date: Mon, 10 Aug 2020 14:33:07 +0000 (+0300) Subject: lib-index: mail_index_sync_map() - Always return -1 on I/O failures X-Git-Tag: 2.3.14.rc1~315 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32ab929a9dbf728a4d2313c00642fe67639d2f1b;p=thirdparty%2Fdovecot%2Fcore.git lib-index: mail_index_sync_map() - Always return -1 on I/O failures Even though with force=FALSE in theory it would be possible to work around it, but more likely it will just cause another I/O error. This simplifies the code for the following changes. --- diff --git a/src/lib-index/mail-index-sync-update.c b/src/lib-index/mail-index-sync-update.c index 494e2c9b39..751481abf1 100644 --- a/src/lib-index/mail-index-sync-update.c +++ b/src/lib-index/mail-index-sync-update.c @@ -959,12 +959,11 @@ int mail_index_sync_map(struct mail_index_map **_map, &reset, &reason); if (ret <= 0) { mail_index_view_close(&view); - if (force && ret < 0) { - /* if we failed because of a syscall error, make sure - we return a failure. */ + if (ret < 0) { + /* I/O failure */ return -1; } - if (force && ret == 0) { + if (force) { /* the seq/offset is probably broken */ mail_index_set_error(index, "Index %s: Lost log for " "seq=%u offset=%"PRIuUOFF_T": %s "