diff options
author | nectar <nectar@FreeBSD.org> | 2003-08-26 16:57:24 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 2003-08-26 16:57:24 +0000 |
commit | 446bd260763fd9ee3710e07af88622edb59ffe8d (patch) | |
tree | 6c9cbb82fd2629bf45e321a40d34235ffbdf39da /sys/dev/bktr | |
parent | d39b66a2b90c1a9e76975c37a12c4df5f8316891 (diff) | |
download | FreeBSD-src-446bd260763fd9ee3710e07af88622edb59ffe8d.zip FreeBSD-src-446bd260763fd9ee3710e07af88622edb59ffe8d.tar.gz |
Revision 1.126 broke the interface of the bktr driver's
METEORSSIGNAL ioctl. Applications use this ioctl with the value
METEOR_SIG_MODE_MASK (0xFFFF0000, -65536) to reset signal delivery,
but revision 1.126 caused the driver to return EINVAL in this case.
Interestingly, the same METEORSSIGNAL ioctl in the meteor driver uses
0 to reset signal delivery.
This commit allows METEOR_SIG_MODE_MASK as a synonym for 0 in the
bktr driver, and restructures the code a bit so that it is otherwise
identical between the bktr and meteor drivers.
Diffstat (limited to 'sys/dev/bktr')
-rw-r--r-- | sys/dev/bktr/bktr_core.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/sys/dev/bktr/bktr_core.c b/sys/dev/bktr/bktr_core.c index 2ca72c8..19795a2 100644 --- a/sys/dev/bktr/bktr_core.c +++ b/sys/dev/bktr/bktr_core.c @@ -915,10 +915,9 @@ common_bktr_intr( void *arg ) * let them know the frame is complete. */ - if (bktr->proc && !(bktr->signal & METEOR_SIG_MODE_MASK)) { + if (bktr->proc != NULL) { PROC_LOCK(bktr->proc); - psignal( bktr->proc, - bktr->signal&(~METEOR_SIG_MODE_MASK) ); + psignal( bktr->proc, bktr->signal); PROC_UNLOCK(bktr->proc); } @@ -1299,6 +1298,7 @@ video_ioctl( bktr_ptr_t bktr, int unit, ioctl_cmd_t cmd, caddr_t arg, struct thr struct bktr_capture_area *cap_area; vm_offset_t buf; int i; + int sig; char char_temp; switch ( cmd ) { @@ -1570,12 +1570,16 @@ video_ioctl( bktr_ptr_t bktr, int unit, ioctl_cmd_t cmd, caddr_t arg, struct thr break; case METEORSSIGNAL: - if(*(int *)arg <= 0 || *(int *)arg > _SIG_MAXSIG) { - return( EINVAL ); - break; - } - bktr->signal = *(int *) arg; - bktr->proc = td->td_proc; + sig = *(int *)arg; + /* Historically, applications used METEOR_SIG_MODE_MASK + * to reset signal delivery. + */ + if (sig == METEOR_SIG_MODE_MASK) + sig = 0; + if (sig < 0 || sig > _SIG_MAXSIG) + return (EINVAL); + bktr->signal = sig; + bktr->proc = sig ? td->td_proc : NULL; break; case METEORGSIGNAL: |