Update from tzcode1998c.
authordrepper <drepper>
Mon, 2 Mar 1998 18:01:35 +0000 (18:01 +0000)
committerdrepper <drepper>
Mon, 2 Mar 1998 18:01:35 +0000 (18:01 +0000)
timezone/private.h
timezone/zic.c

index 7f98a67..f36541c 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 #ifndef NOID
-static char    privatehid[] = "@(#)private.h   7.46";
+static char    privatehid[] = "@(#)private.h   7.47";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 
@@ -46,6 +46,10 @@ static char  privatehid[] = "@(#)private.h   7.46";
 #define HAVE_STRERROR          0
 #endif /* !defined HAVE_STRERROR */
 
+#ifndef HAVE_SYMLINK
+#define HAVE_SYMLINK           1
+#endif /* !defined HAVE_SYMLINK */
+
 #ifndef HAVE_UNISTD_H
 #define HAVE_UNISTD_H          1
 #endif /* !defined HAVE_UNISTD_H */
index adec622..2397a78 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef lint
 #ifndef NOID
-static char    elsieid[] = "@(#)zic.c  7.93";
+static char    elsieid[] = "@(#)zic.c  7.94";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 
@@ -601,23 +601,20 @@ const char * const        tofile;
        if (!itsdir(toname))
                (void) remove(toname);
        if (link(fromname, toname) != 0) {
-               int failure = errno;
-               if (failure == ENOENT)
-                       if (mkdirs(toname) != 0)
-                               failure = errno;
-                       else if (link(fromname, toname) == 0)
-                               failure = 0;
-                       else
-                               failure = errno;
-#ifndef MISSING_SYMLINK
-               if (failure == EXDEV)
-                       if (symlink(fromname, toname) != 0)
-                               failure = errno;
-                       else
-                               failure = 0;
+               int     result;
+
+               if (mkdirs(toname) != 0)
+                       (void) exit(EXIT_FAILURE);
+               result = link(fromname, toname);
+#if (HAVE_SYMLINK - 0) 
+               if (result != 0) {
+                       result = symlink(fromname, toname);
+                       if (result == 0)
+warning(_("hard link failed, symbolic link used"));
+               }
 #endif
-               if (failure) {
-                       const char *e = strerror(failure);
+               if (result != 0) {
+                       const char *e = strerror(errno);
 
                        (void) fprintf(stderr,
                                _("%s: Can't link from %s to %s: %s\n"),