]> git.ipfire.org Git - thirdparty/dovecot/core.git/commit
lib-index: mail_transaction_log_view_set() - Return -1 only on I/O error
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 10 Aug 2020 14:12:32 +0000 (17:12 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Mon, 23 Nov 2020 13:19:54 +0000 (13:19 +0000)
commit327da2aa8a236d6e6481808c8b3bfa9c0cb3e101
tree09e7a2e46f64242962435ecc3e13da8d24a515fd
parent39e2477b7c111bf2e279afe48e188175dd8765d0
lib-index: mail_transaction_log_view_set() - Return -1 only on I/O error

The callers that care about the difference:

 * mail_index_sync_map() already assumes that -1 means I/O error
 * mail_index_sync_set_log_view() handles 0 by logging an error and fscking
   the index, which is likely better than just returning failure.
 * view_sync_set_log_view_range()'s caller handles 0 by rebuilding the
   missing changes in memory. So returning 0 makes it work better.
 * dsync_log_set() and mailbox_get_expunges_init() have fallbacks for
   handling 0, while -1 would just return an error.
src/lib-index/mail-transaction-log-view.c
src/lib-index/mail-transaction-log.h
src/lib-index/test-mail-transaction-log-view.c