If syslog fails to talk to syslogd, then it tries to write a message

to the console in a final attempt to log something. Make this final
attempt non-blocking so that a blocking console doesn't end up
blocking process which attempt to syslog something.

In particular, this means you should be able to su and fix the
problem if the console becomes blocking.

MFC after:	3 weeks
This commit is contained in:
David Malone 2002-03-09 11:38:01 +00:00
parent 93581d7445
commit 94998878b7

View File

@ -255,12 +255,12 @@ vsyslog(pri, fmt, ap)
return;
/*
* 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.
* Output the message to the console; try not to block
* as a blocking console should not stop other processes.
* Make sure the error reported is the one from the syslogd failure.
*/
if (LogStat & LOG_CONS &&
(fd = _open(_PATH_CONSOLE, O_WRONLY, 0)) >= 0) {
(fd = _open(_PATH_CONSOLE, O_WRONLY|O_NONBLOCK, 0)) >= 0) {
struct iovec iov[2];
struct iovec *v = iov;