From 847e723ac35e96c48c6666ee20d8a97fe5cb7f62 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Mon, 1 Jun 2020 13:27:49 +0200 Subject: [PATCH] global: don't override the pidfile-locking errno. Signed-off-by: Radoslaw Zarzynski --- src/global/pidfile.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/global/pidfile.cc b/src/global/pidfile.cc index 69b8467b37e34..b259668b3b233 100644 --- a/src/global/pidfile.cc +++ b/src/global/pidfile.cc @@ -177,9 +177,10 @@ int pidfh::open(std::string_view pid_file) derr << __func__ << ": failed to lock pidfile " << pf_path << "': " << cpp_strerror(errno) << dendl; } + const auto lock_errno = errno; ::close(pf_fd); reset(); - return -errno; + return -lock_errno; } return 0; } -- 2.39.5