diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2010-07-26 01:56:28 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2010-07-26 01:56:28 +0000 |
commit | 12738501a521de949783a0ef772f333a85a28079 (patch) | |
tree | a8d79b5579bc5fb4f0fe053219d7da149a912112 /sys/dev/usb | |
parent | 58397ea88d58979fc9e046dc9c64692785b924ae (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/dev/usb')
-rw-r--r-- | sys/dev/usb/uhid.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index 6ebeba10455..9955bca0a97 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhid.c,v 1.47 2009/11/23 11:10:16 yuo Exp $ */ +/* $OpenBSD: uhid.c,v 1.48 2010/07/26 01:56:27 guenther Exp $ */ /* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -81,10 +81,10 @@ struct uhid_softc { struct clist sc_q; struct selinfo sc_rsel; - struct proc *sc_async; /* process that wants SIGIO */ - u_char sc_state; /* driver state */ -#define UHID_ASLP 0x01 /* waiting for device data */ -#define UHID_IMMED 0x02 /* return read data immediately */ + struct process *sc_async; /* process that wants SIGIO */ + u_char sc_state; /* driver state */ +#define UHID_ASLP 0x01 /* waiting for device data */ +#define UHID_IMMED 0x02 /* return read data immediately */ int sc_refcnt; u_char sc_dying; @@ -236,7 +236,7 @@ uhid_intr(struct uhidev *addr, void *data, u_int len) selwakeup(&sc->sc_rsel); if (sc->sc_async != NULL) { DPRINTFN(3, ("uhid_intr: sending SIGIO %p\n", sc->sc_async)); - psignal(sc->sc_async, SIGIO); + prsignal(sc->sc_async, SIGIO); } } @@ -427,7 +427,7 @@ uhid_do_ioctl(struct uhid_softc *sc, u_long cmd, caddr_t addr, if (*(int *)addr) { if (sc->sc_async != NULL) return (EBUSY); - sc->sc_async = p; + sc->sc_async = p->p_p; DPRINTF(("uhid_do_ioctl: FIOASYNC %p\n", p)); } else sc->sc_async = NULL; @@ -437,7 +437,7 @@ uhid_do_ioctl(struct uhid_softc *sc, u_long cmd, caddr_t addr, case TIOCSPGRP: if (sc->sc_async == NULL) return (EINVAL); - if (*(int *)addr != sc->sc_async->p_pgid) + if (*(int *)addr != sc->sc_async->ps_pgid) return (EPERM); break; |