Applied patch by Michael Pomraning <mjp@securepipe.com> to reconnect

klogd to the logger after it went away.
This commit is contained in:
Joey Schulze 2003-08-27 15:55:04 +00:00
parent 1ff125949b
commit d672afd83d

View File

@ -97,7 +97,7 @@ vsyslog(pri, fmt, ap)
register int cnt;
register char *p;
time_t now;
int fd, saved_errno;
int fd, r, saved_errno;
char tbuf[2048], fmt_cpy[1024], *stdp = (char *) 0;
saved_errno = errno;
@ -167,7 +167,13 @@ vsyslog(pri, fmt, ap)
}
/* output the message to the local logger */
if (write(LogFile, tbuf, cnt + 1) >= 0 || !(LogStat&LOG_CONS))
r = write(LogFile, tbuf, cnt + 1);
if (r == -1 && (errno == ECONNRESET || errno == ENOTCONN)) {
closelog();
}
if (r >= 0 || !(LogStat&LOG_CONS))
return;
/*