summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_proc.c
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2009-10-01 21:44:30 +0000
committeremaste <emaste@FreeBSD.org>2009-10-01 21:44:30 +0000
commit93e81ca09874ae88cacfbc3f55e0e5ed994b77b0 (patch)
tree95d0b8ac5e4090460ed1cccfce824a21c0be3903 /sys/kern/kern_proc.c
parenta4d520ccb00f763ccd4dd0b5ed115e9fcb02cfb5 (diff)
downloadFreeBSD-src-93e81ca09874ae88cacfbc3f55e0e5ed994b77b0.zip
FreeBSD-src-93e81ca09874ae88cacfbc3f55e0e5ed994b77b0.tar.gz
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 MFC after: 1 week
Diffstat (limited to 'sys/kern/kern_proc.c')
-rw-r--r--sys/kern/kern_proc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index e012a3e..f931245 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,
OpenPOWER on IntegriCloud