diff options
author | Dan Harnett <danh@cvs.openbsd.org> | 2003-02-27 17:26:11 +0000 |
---|---|---|
committer | Dan Harnett <danh@cvs.openbsd.org> | 2003-02-27 17:26:11 +0000 |
commit | be8318d8174845a4c63de35b8f79c5a03cc6075d (patch) | |
tree | 59fb57a6dcee2ebf94b67ef5313173a1d210fa31 /lib/libc/gen/syslog.c | |
parent | 2a75924777dc6abad15f8f40a34cb2e4cc793dda (diff) |
correctly check the return value of send(). fixes LOG_CONS from always
logging to the console.
ok millert@
Diffstat (limited to 'lib/libc/gen/syslog.c')
-rw-r--r-- | lib/libc/gen/syslog.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c index d65c34d0a4a..1606ac9e075 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.23 2003/02/07 21:47:14 millert Exp $"; +static char rcsid[] = "$OpenBSD: syslog.c,v 1.24 2003/02/27 17:26:10 danh Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -281,7 +281,7 @@ vsyslog_r(pri, data, fmt, ap) * as a blocking console should not stop other processes. * Make sure the error reported is the one from the syslogd failure. */ - if (error != 0 && (data->log_stat & LOG_CONS) && + if (error == -1 && (data->log_stat & LOG_CONS) && (fd = open(_PATH_CONSOLE, O_WRONLY|O_NONBLOCK, 0)) >= 0) { struct iovec iov[2]; |