]> git.ipfire.org Git - thirdparty/util-linux.git/commit
rename: use access(3) to check if a file exists
authorSami Kerola <kerolasa@iki.fi>
Sun, 3 Dec 2017 12:51:15 +0000 (12:51 +0000)
committerKarel Zak <kzak@redhat.com>
Mon, 4 Dec 2017 12:04:12 +0000 (13:04 +0100)
commit378d58abb1c0d417dc9d4341e9852c27dd475dd7
tree349dcefade04a385d619bfbfece095b6e4c128be
parenta16f45d4f6c17f9f7baf65b32a8e2b2ebe6c1bc2
rename: use access(3) to check if a file exists

This is more lightweight than calling stat(3).  In same go add a regression
test to ensure changes like this will not break --no-overwrite option.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
misc-utils/rename.c
tests/expected/rename/overwrite [new file with mode: 0644]
tests/ts/rename/overwrite [new file with mode: 0755]