From 1aba97eb083950175a4d5add1038daa24f4efc49 Mon Sep 17 00:00:00 2001 From: Arthur David Olson Date: Tue, 5 Jun 2001 13:48:09 -0400 Subject: [PATCH] Eggert mods SCCS-file: zic.c SCCS-SID: 7.102 --- zic.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/zic.c b/zic.c index f483897..4f2eb2b 100644 --- a/zic.c +++ b/zic.c @@ -7,9 +7,15 @@ static char elsieid[] = "%W%"; #include "private.h" #include "locale.h" #include "tzfile.h" -#ifdef unix -#include "sys/stat.h" /* for umask manifest constants */ -#endif /* defined unix */ + +#if HAVE_SYS_STAT_H +#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) +#else +#define MKDIR_UMASK 0755 +#endif /* ** On some ancient hosts, predicates like `isspace(C)' are defined @@ -613,7 +619,7 @@ const char * const tofile; (void) exit(EXIT_FAILURE); result = link(fromname, toname); -#if (HAVE_SYMLINK - 0) +#if (HAVE_SYMLINK - 0) if (result != 0) { const char *s = tofile; register char * symlinkcontents = NULL; @@ -2187,7 +2193,7 @@ char * const argname; ** created by some other multiprocessor, so we get ** to do extra checking. */ - if (mkdir(name, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) != 0) { + if (mkdir(name, MKDIR_UMASK) != 0) { const char *e = strerror(errno); if (errno != EEXIST || !itsdir(name)) {