From 546a709f202024c8a5173ad372a87ddc1c284c63 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 29 Aug 2019 15:04:49 +0200 Subject: daemon: Don't reply on 'st_blocks'. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ported by Ludovic Courtès from . * nix/libstore/gc.cc (LocalStore::removeUnusedLinks): Use 'st.st_size' instead of 'st.st_blocks * 512'. * nix/libutil/util.cc (_deletePath): Likewise. --- nix/libutil/util.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nix/libutil/util.cc') 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. */ -- cgit 1.4.1