aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/pathlocks.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-17 04:55:47 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-17 04:58:43 +0000
commit517f5980e2c63af47e7042873cc33b521918ad35 (patch)
tree19438d2e71fdf45e5af07cdd081477e5e89d6df1 /src/libstore/pathlocks.cc
parente5cc1ebc5db1ef837da82f5ce7824bb29cbcc44b (diff)
parent29542865cee37ab22efe1bd142900b69f6c59f0d (diff)
Merge remote-tracking branch 'upstream/master' into no-stringly-typed-derivation-output
Diffstat (limited to 'src/libstore/pathlocks.cc')
-rw-r--r--src/libstore/pathlocks.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc
index 2635e3940..926f4ea1e 100644
--- a/src/libstore/pathlocks.cc
+++ b/src/libstore/pathlocks.cc
@@ -20,7 +20,7 @@ AutoCloseFD openLockFile(const Path & path, bool create)
fd = open(path.c_str(), O_CLOEXEC | O_RDWR | (create ? O_CREAT : 0), 0600);
if (!fd && (create || errno != ENOENT))
- throw SysError(format("opening lock file '%1%'") % path);
+ throw SysError("opening lock file '%1%'", path);
return fd;
}
@@ -51,7 +51,7 @@ bool lockFile(int fd, LockType lockType, bool wait)
while (flock(fd, type) != 0) {
checkInterrupt();
if (errno != EINTR)
- throw SysError(format("acquiring/releasing lock"));
+ throw SysError("acquiring/releasing lock");
else
return false;
}
@@ -60,7 +60,7 @@ bool lockFile(int fd, LockType lockType, bool wait)
checkInterrupt();
if (errno == EWOULDBLOCK) return false;
if (errno != EINTR)
- throw SysError(format("acquiring/releasing lock"));
+ throw SysError("acquiring/releasing lock");
}
}
@@ -124,7 +124,7 @@ bool PathLocks::lockPaths(const PathSet & paths,
hasn't been unlinked). */
struct stat st;
if (fstat(fd.get(), &st) == -1)
- throw SysError(format("statting lock file '%1%'") % lockPath);
+ throw SysError("statting lock file '%1%'", lockPath);
if (st.st_size != 0)
/* This lock file has been unlinked, so we're holding
a lock on a deleted file. This means that other
@@ -160,7 +160,8 @@ void PathLocks::unlock()
if (close(i.first) == -1)
printError(
- format("error (ignored): cannot close lock file on '%1%'") % i.second);
+ "error (ignored): cannot close lock file on '%1%'",
+ i.second);
debug(format("lock released on '%1%'") % i.second);
}