aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/local-binary-cache-store.cc
diff options
context:
space:
mode:
authorThéophane Hufschmitt <theophane@hufschmitt.net>2022-03-17 15:28:46 +0100
committerThéophane Hufschmitt <theophane.hufschmitt@tweag.io>2022-08-03 10:27:25 +0200
commitc2de0a232c1cfddb1f1385ffd23dd43a2099458e (patch)
tree1e174413830f7951f995fcbe417bb132a2dbb081 /src/libstore/local-binary-cache-store.cc
parent8119390abcbb25e849acc50d0af0b37d85adfb04 (diff)
Create a wrapper around stdlib’s `rename`
Directly takes some c++ strings, and gently throws an exception on error (rather than having to inline this logic everywhere)
Diffstat (limited to 'src/libstore/local-binary-cache-store.cc')
-rw-r--r--src/libstore/local-binary-cache-store.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libstore/local-binary-cache-store.cc b/src/libstore/local-binary-cache-store.cc
index ba4416f6d..ff7403f9d 100644
--- a/src/libstore/local-binary-cache-store.cc
+++ b/src/libstore/local-binary-cache-store.cc
@@ -57,8 +57,7 @@ protected:
AutoDelete del(tmp, false);
StreamToSourceAdapter source(istream);
writeFile(tmp, source);
- if (rename(tmp.c_str(), path2.c_str()))
- throw SysError("renaming '%1%' to '%2%'", tmp, path2);
+ moveFile(tmp, path2);
del.cancel();
}