]> git.ipfire.org Git - thirdparty/zstd.git/commit
Don't Block Removing File on Being Able to Read It
authorW. Felix Handte <w@felixhandte.com>
Mon, 8 Mar 2021 22:49:20 +0000 (17:49 -0500)
committerW. Felix Handte <w@felixhandte.com>
Wed, 5 May 2021 17:10:34 +0000 (13:10 -0400)
commit1fb10ba831bc01cc19427be5eb02021cfa8d2dca
tree82867285b45b5beb27b468dbb7027a82ea355b5d
parentb87f97b3ea5a51eb884a62849cf752187bfb8004
Don't Block Removing File on Being Able to Read It

`open()`'s mode bits are only applied to files that are created by the call.
If the output file already exists, but is not readable, the `fopen()` would
fail, preventing us from removing it, which would mean that the file would
not end up with the correct permission bits.

It's not clear to me why the `fopen()` is there at all. `UTIL_isRegularFile()`
should be sufficient, AFAICT.
programs/fileio.c
tests/playTests.sh