mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Update.
2001-08-27 Ulrich Drepper <drepper@redhat.com> * misc/syslog.c (vsyslog): Try a bit harder to use syslogd. If the connection went down after we first used it try to connect again and resend the message before printing to the console. Reported by Coserea Gh. Tudor <tudore@tudore.gecadsoftware.com>. 2001-08-27 Jakub Jelinek <jakub@redhat.com> * string/tst-strlen.c (main): Test strnlen (, -1) too. * sysdeps/generic/strnlen.c (__strnlen): Fix for maxlens with top bit set. 2001-08-27 Ulrich Drepper <drepper@redhat.com> * iconv/strtab.c (searchstring): Use correct length for comparison. (strtabadd): Account total size correct if new string has old string as substring.
This commit is contained in:
@ -239,17 +239,29 @@ vsyslog(pri, fmt, ap)
|
||||
|
||||
if (!connected || __send(LogFile, buf, bufsize, 0) < 0)
|
||||
{
|
||||
closelog_internal (); /* attempt re-open next time */
|
||||
/*
|
||||
* Output the message to the console; don't worry about blocking,
|
||||
* if console blocks everything will. Make sure the error reported
|
||||
* is the one from the syslogd failure.
|
||||
*/
|
||||
if (LogStat & LOG_CONS &&
|
||||
(fd = __open(_PATH_CONSOLE, O_WRONLY|O_NOCTTY, 0)) >= 0)
|
||||
if (connected)
|
||||
{
|
||||
dprintf (fd, "%s\r\n", buf + msgoff);
|
||||
(void)__close(fd);
|
||||
/* Try to reopen the syslog connection. Maybe it went
|
||||
down. */
|
||||
closelog_internal ();
|
||||
openlog_internal(LogTag, LogStat | LOG_NDELAY, 0);
|
||||
}
|
||||
|
||||
if (!connect || __send(LogFile, buf, bufsize, 0) < 0)
|
||||
{
|
||||
closelog_internal (); /* attempt re-open next time */
|
||||
/*
|
||||
* Output the message to the console; don't worry
|
||||
* about blocking, if console blocks everything will.
|
||||
* Make sure the error reported is the one from the
|
||||
* syslogd failure.
|
||||
*/
|
||||
if (LogStat & LOG_CONS &&
|
||||
(fd = __open(_PATH_CONSOLE, O_WRONLY|O_NOCTTY, 0)) >= 0)
|
||||
{
|
||||
dprintf (fd, "%s\r\n", buf + msgoff);
|
||||
(void)__close(fd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user