gout

A static git page generator
git clone https://git.bracken.jp/gout.git
Log | Files | Refs | README | LICENSE

commit 0c98c2767105ece2b087e0b002be27ca23893778
parent 7a782b595fb5b90b881c833cd66e106a9da22342
Author: Chris Bracken <chris@bracken.jp>
Date:   Fri, 20 Feb 2026 21:29:46 +0900

cache: make umask() restoration more obvious

We were temporarily setting the umask to zero to capture its value, but
the code already took two lines, so may as well assign on the first and
restore on the next in a more obvious way.

Diffstat:
Msrc/writer/cache/cache.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/writer/cache/cache.c b/src/writer/cache/cache.c @@ -176,8 +176,8 @@ void cache_close_and_replace(Cache* cache, FILE* out) { err(1, "rename: %s -> %s", cache->temp_cache_path, cache->cache_path); } - mode_t mask; - umask(mask = umask(0)); + mode_t mask = umask(0); + umask(mask); if (cache->fs->chmod(cache->cache_path, kReadWriteAll & ~mask)) { err(1, "chmod: %s", cache->cache_path); }