1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-28 12:01:49 +02:00

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.
This commit is contained in:
Eelco Dolstra
2019-08-29 15:04:49 +02:00
committed by Ludovic Courtès
parent 7d09f2e85f
commit 546a709f20
2 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -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. */