diff options
author | Théophane Hufschmitt <theophane@hufschmitt.net> | 2022-03-17 15:28:46 +0100 |
---|---|---|
committer | Théophane Hufschmitt <theophane.hufschmitt@tweag.io> | 2022-08-03 10:27:25 +0200 |
commit | c2de0a232c1cfddb1f1385ffd23dd43a2099458e (patch) | |
tree | 1e174413830f7951f995fcbe417bb132a2dbb081 /src/libstore/local-binary-cache-store.cc | |
parent | 8119390abcbb25e849acc50d0af0b37d85adfb04 (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.cc | 3 |
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(); } |