]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Sun, 2 May 1999 11:05:14 +0000 (11:05 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 2 May 1999 11:05:14 +0000 (11:05 +0000)
1999-05-02  H.J. Lu  <hjl@gnu.org>

* timezone/zic.c (dolink): Remove the symlink destination first.

* catgets/open_catalog.c (__open_catalog): Set catalog->status
to "nonexisting" if failed to open the file.

ChangeLog
catgets/open_catalog.c
timezone/zic.c

index c1bcefe440a4436f9bf939fc7aff1e185ab65b6e..8f711200c9d6b2050f7af5c3239e7dec311d9b12 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1999-05-02  H.J. Lu  <hjl@gnu.org>
+
+       * timezone/zic.c (dolink): Remove the symlink destination first.
+
+       * catgets/open_catalog.c (__open_catalog): Set catalog->status
+       to "nonexisting" if failed to open the file.
+
 1999-05-01  Ulrich Drepper  <drepper@cygnus.com>
 
        * string/bits/string2.h: Only use __builtin_memset for egcs 1.1 and
index 4b619e49e93c20dd686985ae526784a8bd42420e..aefa34f3fa4fb90719cf550c16e0e06d0a2deca9 100644 (file)
@@ -183,7 +183,10 @@ __open_catalog (__nl_catd catalog)
 
   /* Avoid dealing with directories and block devices */
   if (fd < 0)
-    goto unlock_return;
+    {
+      catalog->status = nonexisting;
+      goto unlock_return;
+    }
 
   if (__fxstat (_STAT_VER, fd, &st) < 0)
     {
index e5c6761d1e20eada4dd5ac199b945922bc2a0ff7..296f284c2aaf229945baa269538b92d4c4d70901 100644 (file)
@@ -621,6 +621,16 @@ const char * const tofile;
                                symlinkcontents = ecatalloc(symlinkcontents, "../");
                        symlinkcontents = ecatalloc(symlinkcontents, fromname);
 
+                       result = unlink(toname);
+                       if (result != 0 && errno != ENOENT) {
+                               const char *e = strerror(errno);
+
+                               (void) fprintf(stderr,
+                                              _("%s: Can't unlink  %s: %s\n"),
+                                              progname, toname, e);
+                               (void) exit(EXIT_FAILURE);
+                       }
+
                        result = symlink(symlinkcontents, toname);
                        if (result == 0)
 warning(_("hard link failed, symbolic link used"));