[tz] [PATCH 3/4] Port zic to Solaris 10 automounts

Paul Eggert eggert at cs.ucla.edu
Mon Dec 13 19:03:51 UTC 2021


* zic.c (mkdirs): Treat ENOSYS like EEXIST when mkdir fails,
to support Solaris 10 automounted mount points.
---
 zic.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/zic.c b/zic.c
index b70a606..1ab636b 100644
--- a/zic.c
+++ b/zic.c
@@ -3563,9 +3563,11 @@ mkdirs(char const *argname, bool ancestors)
 		if (mkdir(name, MKDIR_UMASK) != 0) {
 			/* Do not report an error if err == EEXIST, because
 			   some other process might have made the directory
-			   in the meantime.  */
+			   in the meantime.  Likewise for ENOSYS, because
+			   Solaris 10 mkdir fails with ENOSYS if the
+			   directory is an automounted mount point.  */
 			int err = errno;
-			if (err != EEXIST) {
+			if (err != EEXIST && err != ENOSYS) {
 				error(_("%s: Can't create directory %s: %s"),
 				      progname, name, strerror(err));
 				exit(EXIT_FAILURE);
-- 
2.32.0



More information about the tz mailing list