summaryrefslogtreecommitdiff
path: root/dev-util/ccache/files/ccache-3.4-size-on-disk.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/ccache/files/ccache-3.4-size-on-disk.patch')
-rw-r--r--dev-util/ccache/files/ccache-3.4-size-on-disk.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/dev-util/ccache/files/ccache-3.4-size-on-disk.patch b/dev-util/ccache/files/ccache-3.4-size-on-disk.patch
new file mode 100644
index 000000000000..4f39a0348f2f
--- /dev/null
+++ b/dev-util/ccache/files/ccache-3.4-size-on-disk.patch
@@ -0,0 +1,21 @@
+https://bugs.gentoo.org/56178
+
+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
+ }
+