diff options
Diffstat (limited to 'third_party/nix/src/libstore/pathlocks.cc')
-rw-r--r-- | third_party/nix/src/libstore/pathlocks.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/third_party/nix/src/libstore/pathlocks.cc b/third_party/nix/src/libstore/pathlocks.cc index d71717e73ed2..ffec3d7d7ea6 100644 --- a/third_party/nix/src/libstore/pathlocks.cc +++ b/third_party/nix/src/libstore/pathlocks.cc @@ -57,8 +57,12 @@ bool lockFile(int fd, LockType lockType, bool wait) { } else { while (flock(fd, type | LOCK_NB) != 0) { checkInterrupt(); - if (errno == EWOULDBLOCK) return false; - if (errno != EINTR) throw SysError(format("acquiring/releasing lock")); + if (errno == EWOULDBLOCK) { + return false; + } + if (errno != EINTR) { + throw SysError(format("acquiring/releasing lock")); + } } } @@ -143,7 +147,9 @@ PathLocks::~PathLocks() { void PathLocks::unlock() { for (auto& i : fds) { - if (deletePaths) deleteLockFile(i.second, i.first); + if (deletePaths) { + deleteLockFile(i.second, i.first); + } if (close(i.first) == -1) { LOG(WARNING) << "cannot close lock file on '" << i.second << "'"; |