summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-07-15 22:33:43 -0400
committerIan Moffett <ian@osmora.org>2024-07-15 22:33:43 -0400
commit342c127a05a23913845f80c200af9a30d0c06068 (patch)
tree7dd1e5b8ffe7a3e196403fa551fc6846ad009c30 /sys/kern
parent824bcfbba8effd367f53c91298cb3bb06415571a (diff)
kernel: fork: Pre-increment nthreads
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_fork.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 421f478..037026b 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -63,7 +63,7 @@ fork1(struct proc *cur, int flags, void(*ip)(void), struct proc **newprocp)
if (newprocp != NULL)
*newprocp = newproc;
- newproc->pid = nthreads++;
+ newproc->pid = ++nthreads;
sched_enqueue_td(newproc);
done:
if (status != 0)