3
0
Fork 0
forked from mirrors/nixpkgs

xfsprogs: Fix build on glibc-2.27

This commit is contained in:
Shea Levy 2018-02-26 07:40:51 -05:00
parent 2929a2c1fa
commit cd843345ff
No known key found for this signature in database
GPG key ID: 5C0BD6957D86FE27
2 changed files with 38 additions and 0 deletions

View file

@ -30,6 +30,7 @@ stdenv.mkDerivation rec {
(gentooPatch "xfsprogs-4.12.0-sharedlibs.patch" "1i081749x91jvlrw84l4a3r081vqcvn6myqhnqbnfcfhd64h12bq")
(gentooPatch "xfsprogs-4.7.0-libxcmd-link.patch" "1lvy1ajzml39a631a7jqficnzsd40bzkca7hkxv1ybiqyp8sf55s")
(gentooPatch "xfsprogs-4.9.0-underlinking.patch" "1r7l8jphspy14i43zbfnjrnyrdm4cpgyfchblascxylmans0gci7")
./glibc-2.27.patch
];
preConfigure = ''

View file

@ -0,0 +1,37 @@
diff -Naur a/io/copy_file_range.c b/io/copy_file_range.c
--- a/io/copy_file_range.c 1969-12-31 19:00:01.000000000 -0500
+++ b/io/copy_file_range.c 2018-02-26 07:39:21.533535821 -0500
@@ -42,24 +42,6 @@
"));
}
-static loff_t
-copy_file_range(int fd, loff_t *src, loff_t *dst, size_t len)
-{
- loff_t ret;
-
- do {
- ret = syscall(__NR_copy_file_range, fd, src, file->fd, dst, len, 0);
- if (ret == -1) {
- perror("copy_range");
- return errno;
- } else if (ret == 0)
- break;
- len -= ret;
- } while (len > 0);
-
- return 0;
-}
-
static off64_t
copy_src_filesize(int fd)
{
@@ -130,7 +112,7 @@
copy_dst_truncate();
}
- ret = copy_file_range(fd, &src, &dst, len);
+ ret = copy_file_range(fd, &src, file->fd, &dst, len, 0);
close(fd);
return ret;
}