]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
cp: fall back to read/write if copy_file_range fails
authorAlan Somers <asomers@FreeBSD.org>
Fri, 11 Sep 2020 20:49:36 +0000 (20:49 +0000)
committerAlan Somers <asomers@FreeBSD.org>
Fri, 11 Sep 2020 20:49:36 +0000 (20:49 +0000)
commit1ea95ba2317b2fe482da0ea1a3d132643a0705b8
treefcd9ec0a7e00bdb1dfa2183ec94133bd8787b61e
parentd8dc46f6e9d32a811865b4c5986fc7146a4bd653
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