diff options
author | Peter Wemm <peter@FreeBSD.org> | 1995-10-05 00:11:15 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 1995-10-05 00:11:15 +0000 |
commit | 11e67a9f2e43c4640fc9e50e721bbba38a8354e4 (patch) | |
tree | ad41a496deeec936619768282a2278e08b145ff9 | |
parent | 378b2956dde08e59656a5a3ec80e29d2fc99e4ef (diff) |
Notes
-rw-r--r-- | lib/libc/gen/syslog.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c index 3c50e25a37ff5..dd5a8cca004f3 100644 --- a/lib/libc/gen/syslog.c +++ b/lib/libc/gen/syslog.c @@ -241,10 +241,16 @@ vsyslog(pri, fmt, ap) */ if (LogStat & LOG_CONS && (fd = open(_PATH_CONSOLE, O_WRONLY, 0)) >= 0) { - (void)strcat(tbuf, "\r\n"); - cnt += 2; - p = index(tbuf, '>') + 1; - (void)write(fd, p, cnt - (p - tbuf)); + struct iovec iov[2]; + register struct iovec *v = iov; + + p = strchr(tbuf, '>') + 1; + v->iov_base = p; + v->iov_len = cnt - (p - tbuf); + ++v; + v->iov_base = "\r\n"; + v->iov_len = 2; + (void)writev(fd, iov, 2); (void)close(fd); } } |