mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-25 01:55:19 +01:00
cat: fallback on EBADF with copy_file_range(2)
When stdout is opened with O_APPEND, copy_file_range(2) fails with EBADF.
This commit is contained in:
parent
2596008a0b
commit
055f920ebe
@ -283,7 +283,7 @@ scanfiles(char *argv[], int cooked __unused)
|
||||
} else {
|
||||
#ifndef BOOTSTRAP_CAT
|
||||
if (in_kernel_copy(fd) == -1) {
|
||||
if (errno == EINVAL)
|
||||
if (errno == EINVAL || errno == EBADF)
|
||||
raw_cat(fd);
|
||||
else
|
||||
err(1, "stdout");
|
||||
|
Loading…
Reference in New Issue
Block a user