]> git.ipfire.org Git - thirdparty/ccache.git/commit
fix: Fix reading of files larger than 2^31 bytes
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 10 Feb 2024 08:54:19 +0000 (09:54 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 12 Feb 2024 19:31:48 +0000 (20:31 +0100)
commit2bf704988762dd1da58a6c01f2b5f91d23bc8e95
tree2f4529ffa2e834d2fad9823d8e4f413615122857
parentfd53f9da3d3b9563ce5ef8e0d9fd28aeb62a6388
fix: Fix reading of files larger than 2^31 bytes

For some kernels read(2) makes a short read for counts larger than 2^31,
even for files on 64-bit architectures. Other kernels seem to not like
large counts at all, returning a failure.

Fix this by limiting the read buffer to a smaller value. This also
removes a short read optimization which should have been removed in
cff3bf417420ea88fe53e7267ae2a356898ae326.

(cherry picked from commit a251091f796a2b67d07ad5b0fa60d1fbc8b5cbff)
src/util/file.cpp