diff options
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/init_main.c | 25 | ||||
-rw-r--r-- | sys/kern/kern_exit.c | 8 | ||||
-rw-r--r-- | sys/kern/kern_sig.c | 4 | ||||
-rw-r--r-- | sys/kern/sys_process.c | 4 |
4 files changed, 23 insertions, 18 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 diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 31164ad99cb..24d9305bb6e 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exit.c,v 1.145 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: kern_exit.c,v 1.146 2014/07/11 08:18:31 guenther Exp $ */ /* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */ /* @@ -286,10 +286,10 @@ exit1(struct proc *p, int rv, int flags) */ qr = LIST_FIRST(&pr->ps_children); if (qr) /* only need this if any child is S_ZOMB */ - wakeup(initproc->p_p); + wakeup(initprocess); for (; qr != 0; qr = nqr) { nqr = LIST_NEXT(qr, ps_sibling); - proc_reparent(qr, initproc->p_p); + proc_reparent(qr, initprocess); /* * Traced processes are killed since their * existence means someone is screwing up. @@ -339,7 +339,7 @@ exit1(struct proc *p, int rv, int flags) */ if (pr->ps_flags & PS_NOZOMBIE) { struct process *ppr = pr->ps_pptr; - proc_reparent(pr, initproc->p_p); + proc_reparent(pr, initprocess); wakeup(ppr); } diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index f46e714d219..0c6294f6b5e 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.169 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.170 2014/07/11 08:18:31 guenther Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -324,7 +324,7 @@ setsigvec(struct proc *p, int signum, struct sigaction *sa) * for PID 1. * XXX exit1 rework means this is unnecessary? */ - if (initproc->p_p->ps_sigacts != ps && + if (initprocess->ps_sigacts != ps && ((sa->sa_flags & SA_NOCLDWAIT) || sa->sa_handler == SIG_IGN)) atomic_setbits_int(&ps->ps_flags, SAS_NOCLDWAIT); diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 088d4f35fff..56cf0e0ea19 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_process.c,v 1.61 2014/05/04 05:03:26 guenther Exp $ */ +/* $OpenBSD: sys_process.c,v 1.62 2014/07/11 08:18:31 guenther Exp $ */ /* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */ /*- @@ -492,7 +492,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval) struct process *ppr; ppr = prfind(tr->ps_oppid); - proc_reparent(tr, ppr ? ppr : initproc->p_p); + proc_reparent(tr, ppr ? ppr : initprocess); } /* not being traced any more */ |