Make sure there is a good default thread name for all threads.

This commit is contained in:
Julian Elischer 2007-11-14 06:04:57 +00:00
parent 502e39a873
commit ca081fdbc5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=173599
2 changed files with 2 additions and 0 deletions

View File

@ -523,6 +523,7 @@ do_execve(td, args, mac_p)
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

View File

@ -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);