From 50f9edb17dedf7d672a1e48b887a7079e4cbf657 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Fri, 14 Nov 2014 23:16:54 +0100 Subject: [PATCH] FileJournal.cc: fix _open() to return negative value in error case Signed-off-by: Danny Al-Gaaf --- src/os/FileJournal.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index 5cebfeb41835..f13f6563c7d0 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -85,6 +85,7 @@ int FileJournal::_open(bool forwrite, bool create) if (ret) { ret = errno; derr << "FileJournal::_open: unable to fstat journal: " << cpp_strerror(ret) << dendl; + ret = -ret; goto out_fd; } @@ -109,6 +110,7 @@ int FileJournal::_open(bool forwrite, bool create) if (ret < 0) { ret = errno; derr << "FileJournal::_open: unable to setup io_context " << cpp_strerror(ret) << dendl; + ret = -ret; goto out_fd; } } -- 2.47.3