]> git.ipfire.org Git - thirdparty/zstd.git/commit
Introduce Variants of Some Functions that Take Optional File Descriptors
authorW. Felix Handte <w@felixhandte.com>
Fri, 3 Feb 2023 21:48:34 +0000 (13:48 -0800)
committerW. Felix Handte <w@felixhandte.com>
Mon, 6 Feb 2023 21:55:34 +0000 (13:55 -0800)
commita5a2418df4e41a826e87ef8ea2205fc2041ac0d2
tree8846df3524fcdccf36d400ee5476401cd1f9c870
parent79bdb8cbb6232370336c2da0d1cc7610b67bb35d
Introduce Variants of Some Functions that Take Optional File Descriptors

Somewhat surprisingly, calling `fchmod()` is non-trivially faster than calling
`chmod()`, and so on.

This commit introduces alternate variants to some common file util functions
that take an optional fd. If present, they call the `f`-variant of the
underlying function. Otherwise, they fall back to the regular filename-taking
version of the function.
programs/util.c
programs/util.h
tests/cli-tests/file-stat/compress-file-to-file.sh.stderr.exact
tests/cli-tests/file-stat/compress-file-to-stdout.sh.stderr.exact
tests/cli-tests/file-stat/compress-stdin-to-file.sh.stderr.exact
tests/cli-tests/file-stat/compress-stdin-to-stdout.sh.stderr.exact
tests/cli-tests/file-stat/decompress-file-to-file.sh.stderr.exact
tests/cli-tests/file-stat/decompress-file-to-stdout.sh.stderr.exact
tests/cli-tests/file-stat/decompress-stdin-to-file.sh.stderr.exact
tests/cli-tests/file-stat/decompress-stdin-to-stdout.sh.stderr.exact