]> git.ipfire.org Git - thirdparty/rsync.git/commit
Extract unlink_and_reopen from copy_file (#294)
authorSam Mikes <sam.mikes@gmail.com>
Sat, 26 Mar 2022 16:14:10 +0000 (10:14 -0600)
committerGitHub <noreply@github.com>
Sat, 26 Mar 2022 16:14:10 +0000 (09:14 -0700)
commitef76d6cfa5ff6b33974083756d3ff0921e5304be
treefdd71df10ff3517b157c6046cb022d5151b62532
parent96ed4b47b9a9d5c30b7da942d3c73ad0c2e93491
Extract unlink_and_reopen from copy_file (#294)

* add tests to exercise copy_file

* Extract new function unlink_and_reopen from copy_file

The argument `ofd` to copy_file is always set to -1 unless
`open_tmpfile()` is called at generator.c:909

This change
 * removes assignment to a function argument
 * renames argument `ofd` to `tmpfilefd` in line with existing uses
 * extracts a new function `unlink_and_reopen` which is static to util1.c
 * rewrites header comments for copy_file
testsuite/copy-file-inplace.test [new file with mode: 0755]
testsuite/copy-file.test [new file with mode: 0644]
util1.c