summary refs log tree commit diff
path: root/nix/libutil
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2019-08-29 15:04:49 +0200
committerLudovic Courtès <ludo@gnu.org>2019-08-30 01:33:45 +0200
commit546a709f202024c8a5173ad372a87ddc1c284c63 (patch)
tree1835b4da705812db6585d217c5f5c0366043c01c /nix/libutil
parent7d09f2e85faa03fd017fef2774c2aa9807c70f43 (diff)
downloadguix-546a709f202024c8a5173ad372a87ddc1c284c63.tar.gz
daemon: Don't reply on 'st_blocks'.
Ported by Ludovic Courtès <ludo@gnu.org>
from <https://github.com/NixOS/nix/commit/a2c4fcd5e9782dc8d2998773380c7171ee53b813>.

* nix/libstore/gc.cc (LocalStore::removeUnusedLinks): Use 'st.st_size'
instead of 'st.st_blocks * 512'.
* nix/libutil/util.cc (_deletePath): Likewise.
Diffstat (limited to 'nix/libutil')
-rw-r--r--nix/libutil/util.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/nix/libutil/util.cc b/nix/libutil/util.cc
index 768e12b5e4..9a83876013 100644
--- a/nix/libutil/util.cc
+++ b/nix/libutil/util.cc
@@ -309,7 +309,7 @@ static void _deletePath(const Path & path, unsigned long long & bytesFreed)
     struct stat st = lstat(path);
 
     if (!S_ISDIR(st.st_mode) && st.st_nlink == 1)
-        bytesFreed += st.st_blocks * 512;
+	bytesFreed += st.st_size;
 
     if (S_ISDIR(st.st_mode)) {
         /* Make the directory writable. */