summaryrefslogtreecommitdiff
path: root/sys/kern/sys_generic.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/sys_generic.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/sys_generic.c')
-rw-r--r--sys/kern/sys_generic.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index 73e30f60fa7..9e49c7fa74f 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_generic.c,v 1.69 2010/07/08 20:15:03 deraadt Exp $ */
+/* $OpenBSD: sys_generic.c,v 1.70 2010/07/26 01:56:27 guenther Exp $ */
/* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */
/*
@@ -476,12 +476,12 @@ sys_ioctl(struct proc *p, void *v, register_t *retval)
if (tmp <= 0) {
tmp = -tmp;
} else {
- struct proc *p1 = pfind(tmp);
- if (p1 == 0) {
+ struct process *pr = prfind(tmp);
+ if (pr == NULL) {
error = ESRCH;
break;
}
- tmp = p1->p_pgrp->pg_id;
+ tmp = pr->ps_pgrp->pg_id;
}
error = (*fp->f_ops->fo_ioctl)
(fp, TIOCSPGRP, (caddr_t)&tmp, p);