about summary refs log tree commit diff
path: root/pkgs/tools/filesystems/xfsprogs/glibc-2.27.patch
blob: 757ea81c9279894bb9720675417243e3de818f47 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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;
 }