summary refs log tree commit diff
path: root/timezone/zic.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-05-02 11:05:14 +0000
committerUlrich Drepper <drepper@redhat.com>1999-05-02 11:05:14 +0000
commit4e720dd60d95bee7af035604010c054ec1b2dc7a (patch)
tree0d4807706a2df70660c8d100f5d080352ab25c2b /timezone/zic.c
parenta97d1494f7dc5ec6978aa234b15faff29a4607ee (diff)
downloadglibc-4e720dd60d95bee7af035604010c054ec1b2dc7a.tar.gz
glibc-4e720dd60d95bee7af035604010c054ec1b2dc7a.tar.xz
glibc-4e720dd60d95bee7af035604010c054ec1b2dc7a.zip
Update.
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.
Diffstat (limited to 'timezone/zic.c')
-rw-r--r--timezone/zic.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/timezone/zic.c b/timezone/zic.c
index e5c6761d1e..296f284c2a 100644
--- a/timezone/zic.c
+++ b/timezone/zic.c
@@ -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"));