mirror of
git://sourceware.org/git/glibc.git
synced 2025-02-17 13:00:43 +08:00
(vsyslog): Don't try to send if not connected to syslog daemon.
(closelog_internal): Don't do anything if not connected.
This commit is contained in:
parent
31497e656e
commit
7a5ab3cdc0
@ -201,7 +201,7 @@ vsyslog(pri, fmt, ap)
|
||||
if (LogType == SOCK_STREAM)
|
||||
++bufsize;
|
||||
|
||||
if (__send(LogFile, buf, bufsize, 0) < 0)
|
||||
if (!connected || __send(LogFile, buf, bufsize, 0) < 0)
|
||||
{
|
||||
closelog_internal (); /* attempt re-open next time */
|
||||
/*
|
||||
@ -297,6 +297,8 @@ sigpipe_handler (int signo)
|
||||
static void
|
||||
closelog_internal()
|
||||
{
|
||||
if (!connected)
|
||||
return;
|
||||
(void)close(LogFile);
|
||||
LogFile = -1;
|
||||
connected = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user