diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2023-04-04 07:39:59 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2023-04-04 07:39:59 +0000 |
commit | 64333654908153cd8e2dcb408c57cc3e3c4f29af (patch) | |
tree | 4e203ac59334ae795d75e534c5dd17473d5c99eb | |
parent | 396b6914c91fcc1879f219715f126a8e8ab824d1 (diff) |
If copy_file_range(2) fails with EXDEV, use fall-back.
-rw-r--r-- | bin/cp/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |