]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common/errorator: fix finally
authorSamuel Just <sjust@redhat.com>
Mon, 28 Sep 2020 20:48:27 +0000 (13:48 -0700)
committerKefu Chai <kchai@redhat.com>
Thu, 26 Nov 2020 10:44:25 +0000 (18:44 +0800)
We need to specify the return type here to ensure we don't lose
the errorator properties.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/common/errorator.h

index 4fdbb53b54869ff0e01812384138f991ab76484f..b396984d4960826db108146a69a040f41856c037 100644 (file)
@@ -596,14 +596,14 @@ private:
     }
 
     template <class FuncT>
-    auto finally(FuncT &&func) {
+    _future finally(FuncT &&func) {
       return this->then_wrapped(
         [func = std::forward<FuncT>(func)](auto &&result) mutable noexcept {
         if constexpr (seastar::is_future<std::invoke_result_t<FuncT>>::value) {
           return ::seastar::futurize_invoke(std::forward<FuncT>(func)).then_wrapped(
             [result = std::move(result)](auto&& f_res) mutable {
             // TODO: f_res.failed()
-            f_res.discard_result();
+            (void)f_res.discard_result();
             return std::move(result);
           });
         } else {