aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/optimise-store.cc
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2020-06-02 08:22:24 -0600
committerBen Burdette <bburdette@gmail.com>2020-06-02 08:22:24 -0600
commitd82d230b4015c50e698e3be1ec7a3e12277a3251 (patch)
treea37b7c45eb868aa15339dae10b3f43e35899fb46 /src/libstore/optimise-store.cc
parent734283d636318b6dfc249afe1ddbb20bb4d02ed4 (diff)
elide the 'ErrorInfo' in logError and logWarning calls
Diffstat (limited to 'src/libstore/optimise-store.cc')
-rw-r--r--src/libstore/optimise-store.cc21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/libstore/optimise-store.cc b/src/libstore/optimise-store.cc
index c9ecca5a8..cc0507be2 100644
--- a/src/libstore/optimise-store.cc
+++ b/src/libstore/optimise-store.cc
@@ -130,10 +130,9 @@ void LocalStore::optimisePath_(Activity * act, OptimiseStats & stats,
NixOS (example: $fontconfig/var/cache being modified). Skip
those files. FIXME: check the modification time. */
if (S_ISREG(st.st_mode) && (st.st_mode & S_IWUSR)) {
- logWarning(
- ErrorInfo {
- .name = "Suspicious file",
- .hint = hintfmt("skipping suspicious writable file '%1%'", path)
+ logWarning({
+ .name = "Suspicious file",
+ .hint = hintfmt("skipping suspicious writable file '%1%'", path)
});
return;
}
@@ -198,10 +197,9 @@ void LocalStore::optimisePath_(Activity * act, OptimiseStats & stats,
}
if (st.st_size != stLink.st_size) {
- logWarning(
- ErrorInfo {
- .name = "Corrupted link",
- .hint = hintfmt("removing corrupted link '%1%'", linkPath)
+ logWarning({
+ .name = "Corrupted link",
+ .hint = hintfmt("removing corrupted link '%1%'", linkPath)
});
unlink(linkPath.c_str());
goto retry;
@@ -237,10 +235,9 @@ void LocalStore::optimisePath_(Activity * act, OptimiseStats & stats,
/* Atomically replace the old file with the new hard link. */
if (rename(tempLink.c_str(), path.c_str()) == -1) {
if (unlink(tempLink.c_str()) == -1)
- logError(
- ErrorInfo {
- .name = "Unlink error",
- .hint = hintfmt("unable to unlink '%1%'", tempLink)
+ logError({
+ .name = "Unlink error",
+ .hint = hintfmt("unable to unlink '%1%'", tempLink)
});
if (errno == EMLINK) {
/* Some filesystems generate too many links on the rename,