mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
daemon: Avoid comparison of integers of different signs.
Fixes guix/guix#1173. * nix/libstore/gc.cc (LocalStore::removeUnusedLinks): Cast ‘st_size’ as unsigned. Reported-by: Congcong Kuo <congcong.kuo@gmail.com> Change-Id: Ibe4674bcef186befe8a0e536278c87458b098c9d
This commit is contained in:
parent
b8f528e733
commit
1970abfeb9
1 changed files with 2 additions and 1 deletions
|
@ -608,7 +608,8 @@ void LocalStore::removeUnusedLinks(const GCState & state)
|
|||
|
||||
/* Drop links for files smaller than 'deduplicationMinSize', even if
|
||||
they have more than one hard link. */
|
||||
if (st.st_nlink != 1 && st.st_size >= deduplicationMinSize) {
|
||||
if (st.st_nlink != 1
|
||||
&& ((unsigned long long) st.st_size) >= deduplicationMinSize) {
|
||||
actualSize += st.st_size;
|
||||
unsharedSize += (st.st_nlink - 1) * st.st_size;
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue