diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2012-04-12 10:11:42 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2012-04-12 10:11:42 +0000 |
commit | 8852854d0fb726cf7f939935fe82f852fdf9d0ac (patch) | |
tree | 8d272c5c3f7eeb7521b28eb5fa96a766fa9c4a2f /sys/kern | |
parent | 027171c03bec751b38f4a293c3af6b3124e0d172 (diff) |
move accounting flags to struct process; idea and ok guenther
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_acct.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_exec.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_fork.c | 5 | ||||
-rw-r--r-- | sys/kern/kern_prot.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_sig.c | 6 |
5 files changed, 12 insertions, 11 deletions
diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index aa519740c5d..ce651a53b33 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_acct.c,v 1.24 2012/03/23 15:51:26 guenther Exp $ */ +/* $OpenBSD: kern_acct.c,v 1.25 2012/04/12 10:11:41 mikeb Exp $ */ /* $NetBSD: kern_acct.c,v 1.42 1996/02/04 02:15:12 christos Exp $ */ /*- @@ -224,7 +224,7 @@ acct_process(struct proc *p) acct.ac_tty = NODEV; /* (8) The boolean flags that tell how the process terminated, etc. */ - acct.ac_flag = p->p_acflag; + acct.ac_flag = pr->ps_acflag; /* * Now, just write the accounting information to the file. diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 1940f070803..c8a202bd463 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exec.c,v 1.127 2012/03/26 04:19:55 deraadt Exp $ */ +/* $OpenBSD: kern_exec.c,v 1.128 2012/04/12 10:11:41 mikeb Exp $ */ /* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */ /*- @@ -475,7 +475,7 @@ sys_execve(struct proc *p, void *v, register_t *retval) bzero(p->p_comm, sizeof(p->p_comm)); len = min(nid.ni_cnd.cn_namelen, MAXCOMLEN); bcopy(nid.ni_cnd.cn_nameptr, p->p_comm, len); - p->p_acflag &= ~AFORK; + pr->ps_acflag &= ~AFORK; /* record proc's vnode, for use by procfs and others */ if (p->p_textvp) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 8bf4a377777..56eae96d07c 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_fork.c,v 1.136 2012/04/10 15:50:52 guenther Exp $ */ +/* $OpenBSD: kern_fork.c,v 1.137 2012/04/12 10:11:41 mikeb Exp $ */ /* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */ /* @@ -501,7 +501,8 @@ fork1(struct proc *curp, int exitsig, int flags, void *stack, pid_t *tidptr, */ SCHED_LOCK(s); getmicrotime(&pr->ps_start); - p->p_acflag = AFORK; + if ((flags & FORK_THREAD) == 0) + pr->ps_acflag = AFORK; p->p_stat = SRUN; p->p_cpu = sched_choosecpu_fork(curp, flags); setrunqueue(p); diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index c4a833de12e..982dfae4bb4 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_prot.c,v 1.53 2012/04/10 15:50:52 guenther Exp $ */ +/* $OpenBSD: kern_prot.c,v 1.54 2012/04/12 10:11:41 mikeb Exp $ */ /* $NetBSD: kern_prot.c,v 1.33 1996/02/09 18:59:42 christos Exp $ */ /* @@ -763,7 +763,7 @@ suser(struct proc *p, u_int flags) if (cred->cr_uid == 0) { if (!(flags & SUSER_NOACCT)) - p->p_acflag |= ASU; + p->p_p->ps_acflag |= ASU; return (0); } return (EPERM); diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 86dfae55cf7..991744db1d3 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.139 2012/04/11 15:28:50 kettenis Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.140 2012/04/12 10:11:41 mikeb Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -1345,7 +1345,7 @@ sigexit(struct proc *p, int signum) /* Mark process as going away */ atomic_setbits_int(&p->p_flag, P_WEXIT); - p->p_acflag |= AXSIG; + p->p_p->ps_acflag |= AXSIG; if (sigprop[signum] & SA_CORE) { p->p_sisig = signum; @@ -1444,7 +1444,7 @@ coredump(struct proc *p) VATTR_NULL(&vattr); vattr.va_size = 0; VOP_SETATTR(vp, &vattr, cred, p); - p->p_acflag |= ACORE; + p->p_p->ps_acflag |= ACORE; io.io_proc = p; io.io_vp = vp; |