mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
copy: handle ENOTSUP from copy_file_range()
* src/copy.c (sparse_copy): Ensure we fall back to a standard copy if copy_file_range() returns ENOTSUP. This generally is best checked when checking ENOSYS, but it also seems to be a practical concern on Centos 7, as a quick search gave https://bugzilla.redhat.com/1840284
This commit is contained in:
1 parent
e35e4d1757
commit
8ec0d1799e
1 file changed
+3
-2
+3
-2
@@ -290,8 +290,9 @@ sparse_copy (int src_fd, int dest_fd, char *buf, size_t buf_size,
|
||||
}
|
||||
if (n_copied < 0)
|
||||
{
|
||||
if (errno == ENOSYS || errno == EINVAL
|
||||
|| errno == EBADF || errno == EXDEV || errno == ETXTBSY)
|
||||
if (errno == ENOSYS || is_ENOTSUP (errno)
|
||||
|| errno == EINVAL || errno == EBADF
|
||||
|| errno == EXDEV || errno == ETXTBSY)
|
||||
break;
|
||||
if (errno == EINTR)
|
||||
n_copied = 0;
|
||||
|
||||
Reference in new issue
Block a user