From 2fecd6061b08b0215a2b1cfe4f3d7e7781bd959d Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Fri, 17 Oct 2025 23:20:06 -0700
Subject: [PATCH 1/3] =?UTF-8?q?MKDIR=5FUMASK=20=E2=86=92=20MKDIR=5FPERMS?=
 =?UTF-8?q?=20refactoring?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* zic.c (MKDIR_PERMS): Rename from MKDIR_UMASK since these are
permission bits, not a umask (the negation of permission bits).
All uses changed.
---
 zic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/zic.c b/zic.c
index 109dbef8..bcaa27cb 100644
--- a/zic.c
+++ b/zic.c
@@ -65,9 +65,9 @@ enum { FORMAT_LEN_GROWTH_BOUND = 5 };
 # include <sys/stat.h>
 #endif
 #ifdef S_IRUSR
-# define MKDIR_UMASK (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
+# define MKDIR_PERMS (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
 #else
-# define MKDIR_UMASK 0755
+# define MKDIR_PERMS 0755
 #endif
 
 /* The minimum alignment of a type, for pre-C23 platforms.
@@ -3982,7 +3982,7 @@ mkdirs(char const *argname, bool ancestors)
 		** not check first whether it already exists, as that
 		** is checked anyway if the mkdir fails.
 		*/
-		if (mkdir(name, MKDIR_UMASK) != 0) {
+		if (mkdir(name, MKDIR_PERMS) < 0) {
 			/* Do not report an error if err == EEXIST, because
 			   some other process might have made the directory
 			   in the meantime.  Likewise for ENOSYS, because
-- 
2.48.1

