]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
cp: fall back to read/write if copy_file_range fails
authorasomers <asomers@FreeBSD.org>
Fri, 11 Sep 2020 20:49:36 +0000 (20:49 +0000)
committerasomers <asomers@FreeBSD.org>
Fri, 11 Sep 2020 20:49:36 +0000 (20:49 +0000)
commit9b858c384885d7431a5c82ec28d6142d142c8bbd
treefcd9ec0a7e00bdb1dfa2183ec94133bd8787b61e
parent3c5ad5f4de391289602c4db6c3e86fc96b852269
cp: fall back to read/write if copy_file_range fails

Even though copy_file_range has a file-system agnostic version, it still
fails on devfs (perhaps because the file descriptor is non-seekable?) In
that case, fallback to old-fashioned read/write. Fixes
"cp /dev/null /tmp/null"

PR: 249248
Reported by: Michael Butler
Reviewed by: mjg
MFC-With: 365549
Differential Revision: https://reviews.freebsd.org/D26395
bin/cp/utils.c