about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/local-binary-cache-store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libstore/local-binary-cache-store.cc')
-rw-r--r--third_party/nix/src/libstore/local-binary-cache-store.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/third_party/nix/src/libstore/local-binary-cache-store.cc b/third_party/nix/src/libstore/local-binary-cache-store.cc
index 58ce7c0911..00bb21eb24 100644
--- a/third_party/nix/src/libstore/local-binary-cache-store.cc
+++ b/third_party/nix/src/libstore/local-binary-cache-store.cc
@@ -59,7 +59,7 @@ static void atomicWrite(const Path& path, const std::string& s) {
   Path tmp = path + ".tmp." + std::to_string(getpid());
   AutoDelete del(tmp, false);
   writeFile(tmp, s);
-  if (rename(tmp.c_str(), path.c_str())) {
+  if (rename(tmp.c_str(), path.c_str()) != 0) {
     throw SysError(format("renaming '%1%' to '%2%'") % tmp % path);
   }
   del.cancel();