diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-07-11 08:18:32 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-07-11 08:18:32 +0000 |
commit | 72f63f7fdd6631099e1fa845fd2628190c5698ad (patch) | |
tree | 2bd39c514f4dad3bcd9106a2fcf3d5a3fba4fb9c /sys/kern/init_main.c | |
parent | 39c8d65399e70823da4c8e62927c33c3f8331158 (diff) |
It's init as a process that's special, not init's original thread.
Remember initprocess instead of initproc.
ok matthew@ blambert@
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r-- | sys/kern/init_main.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index fa5444ce1aa..3ca4b9e1fb0 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.215 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: init_main.c,v 1.216 2014/07/11 08:18:31 guenther Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -114,7 +114,7 @@ struct process process0; struct plimit limit0; struct vmspace vmspace0; struct sigacts sigacts0; -struct proc *initproc; +struct process *initprocess; struct proc *reaperproc; int cmask = CMASK; @@ -431,15 +431,20 @@ main(void *framep) * wait for us to inform it that the root file system has been * mounted. */ - if (fork1(p, FORK_FORK, NULL, 0, start_init, NULL, NULL, - &initproc)) - panic("fork init"); + { + struct proc *initproc; + + if (fork1(p, FORK_FORK, NULL, 0, start_init, NULL, NULL, + &initproc)) + panic("fork init"); + initprocess = initproc->p_p; + } randompid = 1; /* * Create any kernel threads whose creation was deferred because - * initproc had not yet been created. + * initprocess had not yet been created. */ kthread_run_deferred_queue(); @@ -478,13 +483,13 @@ main(void *framep) p->p_fd->fd_rdir = NULL; /* - * Now that root is mounted, we can fixup initproc's CWD + * Now that root is mounted, we can fixup initprocess's CWD * info. All other processes are kthreads, which merely * share proc0's CWD info. */ - initproc->p_fd->fd_cdir = rootvnode; - vref(initproc->p_fd->fd_cdir); - initproc->p_fd->fd_rdir = NULL; + initprocess->ps_fd->fd_cdir = rootvnode; + vref(initprocess->ps_fd->fd_cdir); + initprocess->ps_fd->fd_rdir = NULL; /* * Now can look at time, having had a chance to verify the time |