Date: Sat, 8 Jul 2023 23:09:09 GMT From: Martin Matuska <mm@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 055f920ebe21 - main - cat: fallback on EBADF with copy_file_range(2) Message-ID: <202307082309.368N99n7009560@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=055f920ebe21b8e05235363bc11a83cc649cdc6a commit 055f920ebe21b8e05235363bc11a83cc649cdc6a Author: Martin Matuska <mm@FreeBSD.org> AuthorDate: 2023-07-08 23:04:25 +0000 Commit: Martin Matuska <mm@FreeBSD.org> CommitDate: 2023-07-08 23:08:46 +0000 cat: fallback on EBADF with copy_file_range(2) When stdout is opened with O_APPEND, copy_file_range(2) fails with EBADF. --- bin/cat/cat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cat/cat.c b/bin/cat/cat.c index 1158a839cfd8..44a406dd037b 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -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");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202307082309.368N99n7009560>