summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-01-16 20:29:23 +0000
committerrwatson <rwatson@FreeBSD.org>2004-01-16 20:29:23 +0000
commitc294b6d48a78594fd8fcac20b10b24e91a628f67 (patch)
tree02b563a65219168ee25c62bfcb979ebb149e45df /sys
parented853de359a5ee44171ee94d4e239b151da2c2fb (diff)
downloadFreeBSD-src-c294b6d48a78594fd8fcac20b10b24e91a628f67.zip
FreeBSD-src-c294b6d48a78594fd8fcac20b10b24e91a628f67.tar.gz
KASSERT() that initproc->p_pid is 1. Very bad things happen if init's
pid isn't 1, and it can actually occur if kthread_create() is called before SUB_SI_CREATE_INIT without RFHIGHPID. Discussed with: jhb
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/init_main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index b9be546..7128835 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -683,6 +683,7 @@ create_init(const void *udata __unused)
error = fork1(&thread0, RFFDG | RFPROC | RFSTOPPED, 0, &initproc);
if (error)
panic("cannot fork init: %d\n", error);
+ KASSERT(initproc->p_pid == 1, ("create_init: initproc->p_pid != 1"));
/* divorce init's credentials from the kernel's */
newcred = crget();
PROC_LOCK(initproc);
OpenPOWER on IntegriCloud