This is the mail archive of the libc-hacker@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

A patch for glibc 2.1.1


> 
> On Sun, May 02, H.J. Lu wrote:
> 
> > the problem is gone. I can build glibc. I assume the bug is either
> > in the older P/III patch or egcs 19990418.
> 
> We use egcs 1.1.2. So I think the problem is the P/III patch.
> 

egcs 1.1.2 != egcs 19990418. egcs 19990418 may miscompile the Linux
kernel 2.2.7 which I am using.

This patch fixes the elm problem and also the problem when you run the
timezone check twice. They are quite obvious. Do I need to explain why
they are needed?


-- 
H.J. Lu (hjl@gnu.org)
---
Sun May  2 10:41:24 1999  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.

Index: timezone/zic.c
===================================================================
RCS file: /work/cvs/gnu/glibc/timezone/zic.c,v
retrieving revision 1.1.1.6
diff -u -p -r1.1.1.6 zic.c
--- timezone/zic.c	1999/04/18 16:25:23	1.1.1.6
+++ timezone/zic.c	1999/05/02 17:38:47
@@ -621,9 +621,19 @@ 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"));
+				warning(_("hard link failed, symbolic link used"));
 			ifree(symlinkcontents);
 		}
 #endif
Index: catgets/open_catalog.c
===================================================================
RCS file: /work/cvs/gnu/glibc/catgets/open_catalog.c,v
retrieving revision 1.1.1.8
diff -u -p -r1.1.1.8 open_catalog.c
--- catgets/open_catalog.c	1999/05/01 18:41:16	1.1.1.8
+++ catgets/open_catalog.c	1999/05/02 17:17:07
@@ -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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]