summaryrefslogtreecommitdiff
path: root/sys/kern/kern_acct.c
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2010-07-26 01:56:28 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2010-07-26 01:56:28 +0000
commit12738501a521de949783a0ef772f333a85a28079 (patch)
treea8d79b5579bc5fb4f0fe053219d7da149a912112 /sys/kern/kern_acct.c
parent58397ea88d58979fc9e046dc9c64692785b924ae (diff)
Correct the links between threads, processes, pgrps, and sessions,
so that the process-level stuff is to/from struct process and not struct proc. This fixes a bunch of problem cases in rthreads. Based on earlier work by blambert and myself, but mostly written at c2k10. Tested by many: deraadt, sthen, krw, ray, and in snapshots
Diffstat (limited to 'sys/kern/kern_acct.c')
-rw-r--r--sys/kern/kern_acct.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c
index 52f002b1a29..0051d4fe1c5 100644
--- a/sys/kern/kern_acct.c
+++ b/sys/kern/kern_acct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_acct.c,v 1.22 2010/01/14 23:12:11 schwarze Exp $ */
+/* $OpenBSD: kern_acct.c,v 1.23 2010/07/26 01:56:27 guenther Exp $ */
/* $NetBSD: kern_acct.c,v 1.42 1996/02/04 02:15:12 christos Exp $ */
/*-
@@ -216,8 +216,9 @@ acct_process(struct proc *p)
acct.ac_gid = p->p_cred->p_rgid;
/* (7) The terminal from which the process was started */
- if ((p->p_flag & P_CONTROLT) && p->p_pgrp->pg_session->s_ttyp)
- acct.ac_tty = p->p_pgrp->pg_session->s_ttyp->t_dev;
+ if ((p->p_p->ps_flags & PS_CONTROLT) &&
+ p->p_p->ps_pgrp->pg_session->s_ttyp)
+ acct.ac_tty = p->p_p->ps_pgrp->pg_session->s_ttyp->t_dev;
else
acct.ac_tty = NODEV;