diff options
author | julian <julian@FreeBSD.org> | 2007-11-14 06:04:57 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2007-11-14 06:04:57 +0000 |
commit | b248158d8d9ce6732f5835ff5c90efc7eae9d38a (patch) | |
tree | 758bc1fb5d158757da01c8475bb9d58b148ae836 /sys | |
parent | 760b9605ef7227e5fd9997437caddc0a708753b9 (diff) | |
download | FreeBSD-src-b248158d8d9ce6732f5835ff5c90efc7eae9d38a.zip FreeBSD-src-b248158d8d9ce6732f5835ff5c90efc7eae9d38a.tar.gz |
Make sure there is a good default thread name for all threads.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_exec.c | 1 | ||||
-rw-r--r-- | sys/kern/kern_thread.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 80ef703..ddeac60 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -523,6 +523,7 @@ interpret: len = min(ndp->ni_cnd.cn_namelen,MAXCOMLEN); bcopy(ndp->ni_cnd.cn_nameptr, p->p_comm, len); p->p_comm[len] = 0; + bcopy(p->p_comm, td->td_name, sizeof(td->td_name)); /* * mark as execed, wakeup the process that vforked (if any) and tell diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index cde764f..bf6dec2 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -232,6 +232,7 @@ proc_linkup(struct proc *p, struct thread *td) /* XXX p_ksi may be null if ksiginfo zone is not ready */ p->p_ksi->ksi_flags = KSI_EXT | KSI_INS; } + bcopy(p->p_comm, td->td_name, sizeof(td->td_name)); LIST_INIT(&p->p_mqnotifier); p->p_numthreads = 0; thread_link(td, p); |