]> 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)
committerGitLab <gitlab@git.dovecot.net>
Sat, 20 May 2017 18:22:23 +0000 (21:22 +0300)
src/lib-index/mail-index-view-sync.c

index 8b027fee561dea0abf0c72cc06ce58873fbabc63..c458798a09a7ea60aec037952b783635661e8320 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;