Skip to content

Commit

Permalink
xfsprogs: Fix build on glibc-2.27
Browse files Browse the repository at this point in the history
  • Loading branch information
shlevy committed Feb 26, 2018
1 parent a5b7c54 commit 2a110b5
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/tools/filesystems/xfsprogs/default.nix
Expand Up @@ -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 = ''
Expand Down
37 changes: 37 additions & 0 deletions pkgs/tools/filesystems/xfsprogs/glibc-2.27.patch
@@ -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;
}

0 comments on commit 2a110b5

Please sign in to comment.