From 4dfc24c370cb0f8bf6c1edc3cc9a42dd1f75ea64 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 18 Feb 2002 00:07:57 +0000 Subject: Open console with O_NONBLOCK to avoid blocking on a locked console. From David Malone --- lib/libc/gen/syslog.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/libc/gen') 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 @@ -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; -- cgit v1.2.3