From 19d9a52e27c709bd147e2611544245ba9e36bfc4 Mon Sep 17 00:00:00 2001 From: marcel Date: Mon, 20 Sep 1999 21:53:17 +0000 Subject: When bcopying the program name into the ktrace header, make sure we include the terminating zero by copying MAXCOMLEN + 1 bytes. This fixes the garbage that occasionally appeared behind the programname when it is at least MAXCOMLEN bytes long (such as communicator-4.61-bin). --- sys/kern/kern_ktrace.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/kern/kern_ktrace.c') diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index bc6f81f..c2dfcac 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -73,7 +73,7 @@ ktrgetheader(type) kth->ktr_type = type; microtime(&kth->ktr_time); kth->ktr_pid = p->p_pid; - bcopy(p->p_comm, kth->ktr_comm, MAXCOMLEN); + bcopy(p->p_comm, kth->ktr_comm, MAXCOMLEN + 1); return (kth); } @@ -194,9 +194,9 @@ done: void ktrpsig(vp, sig, action, mask, code) struct vnode *vp; - int sig; + int sig, code; sig_t action; - int mask, code; + sigset_t *mask; { struct ktr_header *kth; struct ktr_psig kp; @@ -206,7 +206,7 @@ ktrpsig(vp, sig, action, mask, code) kth = ktrgetheader(KTR_PSIG); kp.signo = (char)sig; kp.action = action; - kp.mask = mask; + kp.mask = *mask; kp.code = code; kth->ktr_buf = (caddr_t)&kp; kth->ktr_len = sizeof (struct ktr_psig); -- cgit v1.1