summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2007-11-15 02:13:44 +0000
committerjulian <julian@FreeBSD.org>2007-11-15 02:13:44 +0000
commitbfb9581757e7dcf392c4fabd6da2a82cbb2aa514 (patch)
tree2f42296779f2323115e230955eed6cb78177e972 /sys/kern/kern_fork.c
parentcbf66fbd28eaf6ddfa6b9018f56d134fbc548f4c (diff)
downloadFreeBSD-src-bfb9581757e7dcf392c4fabd6da2a82cbb2aa514.zip
FreeBSD-src-bfb9581757e7dcf392c4fabd6da2a82cbb2aa514.tar.gz
When forking, the new thread deserves a name too. Don't just use the
td_startcopy section as it is not the right thing to do in other cases (e.g. if starting a new thread from one that is already named).
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 4c5a730..e6f891d 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -495,6 +495,7 @@ again:
bcopy(&td->td_startcopy, &td2->td_startcopy,
__rangeof(struct thread, td_startcopy, td_endcopy));
+ bcopy(&p2->p_comm, &td2->td_name, sizeof(td2->td_name));
td2->td_sigstk = td->td_sigstk;
td2->td_sigmask = td->td_sigmask;
td2->td_flags = TDF_INMEM;
OpenPOWER on IntegriCloud