From 7a8e2b8f91b9b57a2649ad4106e32024a892607e Mon Sep 17 00:00:00 2001 From: emaste Date: Mon, 2 Nov 2009 16:32:32 +0000 Subject: [PATCH] MFC r197692: In fill_kinfo_thread, copy the thread's name into struct kinfo_proc even if it is empty. Otherwise the previous thread's name would remain in the struct and then be reported for this thread. Submitted by: Ryan Stone git-svn-id: svn://svn.freebsd.org/base/stable/8@198805 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/kern/kern_proc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index e012a3ed4..f931245fd 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -847,8 +847,7 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp, int preferthread) strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg)); else bzero(kp->ki_wmesg, sizeof(kp->ki_wmesg)); - if (td->td_name[0] != '\0') - strlcpy(kp->ki_ocomm, td->td_name, sizeof(kp->ki_ocomm)); + strlcpy(kp->ki_ocomm, td->td_name, sizeof(kp->ki_ocomm)); if (TD_ON_LOCK(td)) { kp->ki_kiflag |= KI_LOCKBLOCK; strlcpy(kp->ki_lockname, td->td_lockname, -- 2.45.0