summaryrefslogtreecommitdiff
blob: a2f4a554cab366b63b480b453adf2d581b5a6743 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
https://bugs.gentoo.org/456178
https://github.com/ccache/ccache/issues/442

stick to the size of files on disk rather than their byte size.
this func is only used for stats management, so this should be safe.

--- a/src/util.c
+++ b/src/util.c
@@ -845,12 +845,7 @@ file_size(struct stat *st)
 #ifdef _WIN32
 	return (st->st_size + 1023) & ~1023;
 #else
-	size_t size = st->st_blocks * 512;
-	if ((size_t)st->st_size > size) {
-		// Probably a broken stat() call...
-		size = (st->st_size + 1023) & ~1023;
-	}
-	return size;
+	return st->st_blocks * 512;
 #endif
 }