summaryrefslogtreecommitdiff
path: root/main/ccache/ioctl.patch
blob: 5ae4c5a75dd6183d1e1947a27217e4719be4fac0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
musl uses an `int` instead of a `unsigend long` for the ioctl function
prototype, contrary to glibc, since POSIX mandates the former. This
causes a spurious error on ppc64le which can be silenced by casting to
int explicitly.

See https://www.openwall.com/lists/musl/2020/01/20/2

diff -upr a/src/ccache/storage/local/LocalStorage.cpp b/src/ccache/storage/local/LocalStorage.cpp
--- a/src/ccache/storage/local/LocalStorage.cpp	2024-06-30 20:46:01.000000000 +0200
+++ b/src/ccache/storage/local/LocalStorage.cpp	2024-07-03 16:29:39.073705276 +0200
@@ -264,7 +264,7 @@ clone_file(const std::string& src, const
     }
   }
 
-  if (ioctl(*dest_fd, FICLONE, *src_fd) != 0) {
+  if (ioctl(*dest_fd, (int)FICLONE, *src_fd) != 0) {
     throw core::Error(strerror(errno));
   }