diff options
-rw-r--r-- | sys/kern/subr_log.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c index b64872a82d8..55d8fcab89b 100644 --- a/sys/kern/subr_log.c +++ b/sys/kern/subr_log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_log.c,v 1.21 2014/07/12 18:43:32 tedu Exp $ */ +/* $OpenBSD: subr_log.c,v 1.22 2014/07/28 20:30:01 bluhm Exp $ */ /* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */ /* @@ -349,6 +349,7 @@ sys_sendsyslog(struct proc *p, void *v, register_t *retval) struct iovec aiov; struct uio auio; struct file *f; + size_t len; int error; if (syslogf == NULL) @@ -374,12 +375,15 @@ sys_sendsyslog(struct proc *p, void *v, register_t *retval) } #endif + len = auio.uio_resid; error = sosend(f->f_data, NULL, &auio, NULL, NULL, 0); + if (error == 0) + len -= auio.uio_resid; #ifdef KTRACE if (ktriov != NULL) { if (error == 0) - ktrgenio(p, 0, UIO_WRITE, ktriov, aiov.iov_len); + ktrgenio(p, -1, UIO_WRITE, ktriov, len); free(ktriov, M_TEMP, 0); } #endif |