about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/pathlocks.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libstore/pathlocks.cc')
-rw-r--r--third_party/nix/src/libstore/pathlocks.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/third_party/nix/src/libstore/pathlocks.cc b/third_party/nix/src/libstore/pathlocks.cc
index ac6d260f84..eeee5ee1e9 100644
--- a/third_party/nix/src/libstore/pathlocks.cc
+++ b/third_party/nix/src/libstore/pathlocks.cc
@@ -53,9 +53,8 @@ bool lockFile(int fd, LockType lockType, bool wait) {
       checkInterrupt();
       if (errno != EINTR) {
         throw SysError(format("acquiring/releasing lock"));
-      } else {
-        return false;
       }
+      return false;
     }
   } else {
     while (flock(fd, type | LOCK_NB) != 0) {
@@ -104,7 +103,7 @@ bool PathLocks::lockPaths(const PathSet& paths, const string& waitMsg,
       /* Acquire an exclusive lock. */
       if (!lockFile(fd.get(), ltWrite, false)) {
         if (wait) {
-          if (waitMsg != "") {
+          if (!waitMsg.empty()) {
             LOG(WARNING) << waitMsg;
           }
           lockFile(fd.get(), ltWrite, true);