]> git.ipfire.org Git - thirdparty/zstd.git/commit
Use File Descriptor in Setting Stat on Output File 3479/head
authorW. Felix Handte <w@felixhandte.com>
Mon, 6 Feb 2023 16:05:47 +0000 (08:05 -0800)
committerW. Felix Handte <w@felixhandte.com>
Mon, 6 Feb 2023 22:02:31 +0000 (14:02 -0800)
commitf746c37d00ae7c4e921b9089e8bf1f87d34adcfb
tree41ebaeb9625ea49ed0696957691406fe96e08a4e
parenta5a2418df4e41a826e87ef8ea2205fc2041ac0d2
Use File Descriptor in Setting Stat on Output File

Note that the `fd` is only valid while the file is still open. So we need to
move the setting calls to before we close the file. However! We cannot do so
with the `utime()` call (even though `futimens()` exists) because the follow-
ing `close()` call to the `fd` will reset the atime of the file. So it seems
the `utime()` call has to happen after the file is closed.
programs/fileio.c
programs/util.c
tests/cli-tests/file-stat/compress-file-to-file.sh.stderr.exact
tests/cli-tests/file-stat/decompress-file-to-file.sh.stderr.exact