copy: do not refuse to copy a swap file
commit785478013b416cde50794be35475c0c4fdbb48b4
authorZorro Lang <zlang@redhat.com>
Mon, 26 Apr 2021 15:25:18 +0000 (26 17:25 +0200)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 27 Apr 2021 01:00:58 +0000 (26 18:00 -0700)
treec53253e1417ee51f957c557afdf5700c9d44170f
parentb7091093bb6505c33279f9bc940b2e94763a6e5d
copy: do not refuse to copy a swap file

* src/copy.c (sparse_copy): Fallback to read() if copy_file_range()
fails with ETXTBSY.  Otherwise it would be impossible to copy files
that are being used as swap.  This used to work before introducing
the support for copy_file_range() in coreutils.  (Bug#48036)
src/copy.c