summaryrefslogtreecommitdiff
path: root/nix/libstore
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2020-06-27 10:23:11 +0200
committerMarius Bakke <marius@gnu.org>2020-06-27 10:23:11 +0200
commit425fd7eb6a5f07eb9b854a5a29488e6f0b0acf3c (patch)
tree44479010890dd9aaf8bc52cab73f7c241a2fd9ea /nix/libstore
parentfe9f2d150019b9fc17f08f5a002d7ca932fc3eb0 (diff)
parent88dbef3b9868a565da1eba37c9d409cce972becc (diff)
Merge branch 'master' into staging
Diffstat (limited to 'nix/libstore')
-rw-r--r--nix/libstore/.gitignore3
-rw-r--r--nix/libstore/optimise-store.cc3
2 files changed, 3 insertions, 3 deletions
diff --git a/nix/libstore/.gitignore b/nix/libstore/.gitignore
index 512a0d022f..805301d6d7 100644
--- a/nix/libstore/.gitignore
+++ b/nix/libstore/.gitignore
@@ -1,3 +1,2 @@
-*.cc
-*.hh
/schema.sql
+/schema.sql.hh
diff --git a/nix/libstore/optimise-store.cc b/nix/libstore/optimise-store.cc
index d8f8d2394b..eb303ab4c3 100644
--- a/nix/libstore/optimise-store.cc
+++ b/nix/libstore/optimise-store.cc
@@ -215,9 +215,10 @@ void LocalStore::optimisePath_(OptimiseStats & stats, const Path & path, InodeHa
/* Atomically replace the old file with the new hard link. */
if (rename(tempLink.c_str(), path.c_str()) == -1) {
+ int renameErrno = errno;
if (unlink(tempLink.c_str()) == -1)
printMsg(lvlError, format("unable to unlink `%1%'") % tempLink);
- if (errno == EMLINK) {
+ if (renameErrno == EMLINK) {
/* Some filesystems generate too many links on the rename,
rather than on the original link. (Probably it
temporarily increases the st_nlink field before