diff options
author | Rob Landley <rob@landley.net> | 2022-03-19 19:57:46 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2022-03-19 19:57:46 -0500 |
commit | 7baa9906839e7affe226f3fbca092d594b903753 (patch) | |
tree | 3a2b55e336c099cca85c2a3e3311edc44ab74cd0 | |
parent | 2f4e6e18b45efe91d78cbbb428d3168eb26dd025 (diff) | |
download | toybox-7baa9906839e7affe226f3fbca092d594b903753.tar.gz |
Fix copy_file_range() fallback.
-rw-r--r-- | lib/portability.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/portability.c b/lib/portability.c index 0d02309d..174933c3 100644 --- a/lib/portability.c +++ b/lib/portability.c @@ -651,8 +651,11 @@ long long sendfile_len(int in, int out, long long bytes, long long *consumed) if (copy_file_range) { if (bytes<0 || bytes>(1<<30)) len = (1<<30); len = copy_file_range_wrap(in, 0, out, 0, len, 0); - if (len < 0 && errno == EINVAL) + if (len < 0 && errno == EINVAL) { copy_file_range = 0; + + continue; + } } if (!copy_file_range) { if (bytes<0 || len>sizeof(libbuf)) len = sizeof(libbuf); |