patches/glibc/2.2.2/glibc-2.2.2-syslog-bugfix.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 08 17:48:32 2007 +0000 (2007-05-08)
changeset 78 c3868084d81a
permissions -rw-r--r--
Huge fixes to glibc build, so that we can build at least (and at last):
- use ports addon even when installing headers,
- use optimisation (-O) when installing headers, to avoid unnecessary warnings (thanks Robert P. J. DAY for pointing this out!),
- lowest kernel version to use is only X.Y.Z, not X.Y.Z.T,
- a bit of preparations for NPTL (RSN I hope),
- fix fixing the linker scripts (changing the backup file is kind of useless and stupid);

Shut uClibc finish step: there really is nothing to do;

Add a patch for glibc-2.3.6 weak aliases handling on some archs (ARM and ALPHA at least);

Did not catch the make errors: fixed the pattern matching in scripts/functions;

Introduce a new log level, ALL:
- send components' build messages there,
- DEBUG log level is destined only for crosstool-NG debug messages,
- migrate sub-actions to use appropriate log levels;

Update the armeb-unknown-linux-gnu sample:
- it builds!
- uses gcc-4.0.4 and glibc-2.3.6,
- updated to latest config options set.
     1 Backport a bugfix from glibc-2.2.5 to glibc-2.2.2 for the following problem:
     2   When syslog-ng is restarted (or HUPed), vixie-cron (and probably other
     3   programs) stop logging to syslog.
     4 
     5 
     6 2001-08-27 Ulrich Drepper <Drepper@redhat.com> * misc/syslog.c (vsyslog):
     7   Try a bit harder to use syslogd.  If the connection went down after we
     8   first used it try to connect again and resend the message before printing
     9   to the console.
    10 
    11 http://sourceware.org/cgi-bin/cvsweb.cgi/libc/misc/Attic/syslog.c.diff?r1=1.32&r2=1.30&cvsroot=glibc
    12 [ paths adjusted ]
    13 
    14 ===================================================================
    15 RCS file: /cvs/glibc/libc/misc/Attic/syslog.c,v
    16 retrieving revision 1.30
    17 retrieving revision 1.32
    18 diff -u -r1.30 -r1.32
    19 --- glibc-2.2.2/misc/syslog.c	2001/08/24 03:21:14	1.30
    20 +++ glibc-2.2.5/misc/syslog.c	2001/08/30 23:13:49	1.32
    21 @@ -239,17 +239,29 @@
    22  
    23  	if (!connected || __send(LogFile, buf, bufsize, 0) < 0)
    24  	  {
    25 -	    closelog_internal ();	/* attempt re-open next time */
    26 -	    /*
    27 -	     * Output the message to the console; don't worry about blocking,
    28 -	     * if console blocks everything will.  Make sure the error reported
    29 -	     * is the one from the syslogd failure.
    30 -	     */
    31 -	    if (LogStat & LOG_CONS &&
    32 -		(fd = __open(_PATH_CONSOLE, O_WRONLY|O_NOCTTY, 0)) >= 0)
    33 +	    if (connected)
    34  	      {
    35 -		dprintf (fd, "%s\r\n", buf + msgoff);
    36 -		(void)__close(fd);
    37 +		/* Try to reopen the syslog connection.  Maybe it went
    38 +		   down.  */
    39 +		closelog_internal ();
    40 +		openlog_internal(LogTag, LogStat | LOG_NDELAY, 0);
    41 +	      }
    42 +
    43 +	    if (!connected || __send(LogFile, buf, bufsize, 0) < 0)
    44 +	      {
    45 +		closelog_internal ();	/* attempt re-open next time */
    46 +		/*
    47 +		 * Output the message to the console; don't worry
    48 +		 * about blocking, if console blocks everything will.
    49 +		 * Make sure the error reported is the one from the
    50 +		 * syslogd failure.
    51 +		 */
    52 +		if (LogStat & LOG_CONS &&
    53 +		    (fd = __open(_PATH_CONSOLE, O_WRONLY|O_NOCTTY, 0)) >= 0)
    54 +		  {
    55 +		    dprintf (fd, "%s\r\n", buf + msgoff);
    56 +		    (void)__close(fd);
    57 +		  }
    58  	      }
    59  	  }
    60