summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/syslog.c
diff options
context:
space:
mode:
authordanh <danh@openbsd.org>2003-02-27 17:26:10 +0000
committerdanh <danh@openbsd.org>2003-02-27 17:26:10 +0000
commitb1647353dfce1228f7fc7ea8011c1c69a59a6745 (patch)
treed58f51d8281b0ec7aa01c2ec50ff1a417947c563 /lib/libc/gen/syslog.c
parentprint out the ethernet address in the dmesg. (diff)
downloadwireguard-openbsd-b1647353dfce1228f7fc7ea8011c1c69a59a6745.tar.xz
wireguard-openbsd-b1647353dfce1228f7fc7ea8011c1c69a59a6745.zip
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.c4
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];