From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gorcunov@gmail.com>
Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com
 [209.85.208.193])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by dev.tarantool.org (Postfix) with ESMTPS id 0C4AD4696C8
 for <tarantool-patches@dev.tarantool.org>;
 Tue, 28 Apr 2020 19:14:10 +0300 (MSK)
Received: by mail-lj1-f193.google.com with SMTP id l19so22094106lje.10
 for <tarantool-patches@dev.tarantool.org>;
 Tue, 28 Apr 2020 09:14:10 -0700 (PDT)
From: Cyrill Gorcunov <gorcunov@gmail.com>
Date: Tue, 28 Apr 2020 19:11:31 +0300
Message-Id: <20200428161137.20536-12-gorcunov@gmail.com>
In-Reply-To: <20200428161137.20536-1-gorcunov@gmail.com>
References: <20200428161137.20536-1-gorcunov@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [Tarantool-patches] [PATCH 11/17] recovery: recovery_finalize --
	don't throw exception
List-Id: Tarantool development patches <tarantool-patches.dev.tarantool.org>
List-Unsubscribe: <https://lists.tarantool.org/mailman/options/tarantool-patches>, 
 <mailto:tarantool-patches-request@dev.tarantool.org?subject=unsubscribe>
List-Archive: <https://lists.tarantool.org/pipermail/tarantool-patches/>
List-Post: <mailto:tarantool-patches@dev.tarantool.org>
List-Help: <mailto:tarantool-patches-request@dev.tarantool.org?subject=help>
List-Subscribe: <https://lists.tarantool.org/mailman/listinfo/tarantool-patches>, 
 <mailto:tarantool-patches-request@dev.tarantool.org?subject=subscribe>
To: tml <tarantool-patches@dev.tarantool.org>

Prepare for transition to plain C.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 src/box/box.cc      | 4 +++-
 src/box/recovery.cc | 5 ++---
 src/box/recovery.h  | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/box/box.cc b/src/box/box.cc
index c269a5da8..31c53a443 100644
--- a/src/box/box.cc
+++ b/src/box/box.cc
@@ -2318,7 +2318,9 @@ local_recovery(const struct tt_uuid *instance_uuid,
 		box_listen();
 		box_sync_replication(false);
 	}
-	recovery_finalize(recovery);
+
+	if (recovery_finalize(recovery) != 0)
+		diag_raise();
 
 	/*
 	 * We must enable WAL before finalizing engine recovery,
diff --git a/src/box/recovery.cc b/src/box/recovery.cc
index af7910bdf..9ed42590c 100644
--- a/src/box/recovery.cc
+++ b/src/box/recovery.cc
@@ -389,11 +389,10 @@ recover_remaining_wals(struct recovery *r, struct xstream *stream,
 	return 0;
 }
 
-void
+int
 recovery_finalize(struct recovery *r)
 {
-	if (recovery_close_log(r) != 0)
-		diag_raise();
+	return recovery_close_log(r);
 }
 
 
diff --git a/src/box/recovery.h b/src/box/recovery.h
index 90fbf1b0a..a8cfa27d1 100644
--- a/src/box/recovery.h
+++ b/src/box/recovery.h
@@ -85,7 +85,7 @@ recovery_follow_local(struct recovery *r, struct xstream *stream,
 void
 recovery_stop_local(struct recovery *r);
 
-void
+int
 recovery_finalize(struct recovery *r);
 
 #if defined(__cplusplus)
-- 
2.20.1