diff --git a/bin/cp/utils.c b/bin/cp/utils.c index 8c1c350ff6f1..9794152ac724 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -180,7 +180,7 @@ copy_file(const FTSENT *entp, int dne) if (use_copy_file_range) { wcount = copy_file_range(from_fd, NULL, to_fd, NULL, SSIZE_MAX, 0); - if (wcount < 0 && errno == EINVAL) { + if (wcount < 0 && (errno == EINVAL || errno == EXDEV)) { /* Prob a non-seekable FD */ use_copy_file_range = 0; }