]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
global: don't override the pidfile-locking errno. 35337/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 1 Jun 2020 11:27:49 +0000 (13:27 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 2 Jun 2020 14:23:47 +0000 (16:23 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/global/pidfile.cc

index 69b8467b37e3487b0a7b86be0fbdc9ab1e7cecc0..b259668b3b233a1c058270ef23eb5d14e9201449 100644 (file)
@@ -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;
 }