(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:
Ulrich Drepper 1998-03-10 21:30:32 +00:00
parent 31497e656e
commit 7a5ab3cdc0

View File

@ -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;