diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-02-18 00:07:57 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-02-18 00:07:57 +0000 |
commit | 4dfc24c370cb0f8bf6c1edc3cc9a42dd1f75ea64 (patch) | |
tree | f1d9f8904bcb3a816add625f9880ff485b2e3eac /lib/libc/gen | |
parent | 6a444c72aa96b7f23d023304655b4d115a2ddd97 (diff) |
Open console with O_NONBLOCK to avoid blocking on a locked console.
From David Malone
Diffstat (limited to 'lib/libc/gen')
-rw-r--r-- | lib/libc/gen/syslog.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c index cb646e29785..dcfc0b9ac01 100644 --- a/lib/libc/gen/syslog.c +++ b/lib/libc/gen/syslog.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: syslog.c,v 1.14 2002/02/16 21:27:23 millert Exp $"; +static char rcsid[] = "$OpenBSD: syslog.c,v 1.15 2002/02/18 00:07:56 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -305,12 +305,12 @@ vsyslog_r(pri, data, 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 (data->log_stat & LOG_CONS && - (fd = open(_PATH_CONSOLE, O_WRONLY, 0)) >= 0) { + (fd = open(_PATH_CONSOLE, O_WRONLY|O_NONBLOCK, 0)) >= 0) { struct iovec iov[2]; p = strchr(tbuf, '>') + 1; |