]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Add missing error logging for mail_index_view_sync_begin()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 17 May 2017 13:21:54 +0000 (16:21 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Mon, 22 May 2017 12:12:28 +0000 (15:12 +0300)
src/lib-index/mail-index-view-sync.c

index 8243e550a4a0a6e9e99442dea225f66b8d005203..c32230c219fd6c91682e79041c67a727a3c470a4 100644 (file)
@@ -74,8 +74,12 @@ view_sync_set_log_view_range(struct mail_index_view *view, bool sync_expunges,
                                                    start_seq, start_offset,
                                                    end_seq, end_offset,
                                                    reset_r, &reason);
-               if (ret <= 0)
+               if (ret <= 0) {
+                       mail_index_set_error(view->index,
+                               "Failed to map view for %s: %s",
+                               view->index->filepath, reason);
                        return ret;
+               }
 
                if (!*reset_r || sync_expunges)
                        break;
@@ -508,12 +512,10 @@ static int mail_index_view_sync_init_fix(struct mail_index_view_sync_ctx *ctx)
 
        ret = mail_transaction_log_view_set(view->log_view, seq, offset,
                                            seq, offset, &reset, &reason);
-       if (ret < 0)
-               return -1;
-       if (ret == 0) {
+       if (ret <= 0) {
                mail_index_set_error(view->index, "Failed to fix view for %s: %s",
                                     view->index->filepath, reason);
-               return 0;
+               return ret;
        }
        view->inconsistent = FALSE;
        return 0;