From 3e2b80a43e8d3778b07c4680c8a2719cd4c7f621 Mon Sep 17 00:00:00 2001 From: Hasso Tepper Date: Mon, 8 Oct 2007 17:55:00 +0000 Subject: [PATCH] Dragonfly always passes a flag for every IO operation depending whether the mode of the operation or of the fd is set to NBIO, but it doesn't pass down fcntl() changes to the drivers. So, if you open /dev/dsp with NONBLOCK and later fcntl it to blocking, the sound driver won't be aware of this fact. Fix: don't maintain this setting in the sound driver. Requested and tested by corecode@. --- sys/dev/sound/pcm/dsp.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index df1ce48a37..37f5c1931b 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pcm/dsp.c,v 1.80.2.6 2006/04/04 17:43:48 ariff Exp $ - * $DragonFly: src/sys/dev/sound/pcm/dsp.c,v 1.15 2007/06/14 21:48:36 corecode Exp $ + * $DragonFly: src/sys/dev/sound/pcm/dsp.c,v 1.16 2007/10/08 17:55:00 hasso Exp $ */ #include @@ -33,7 +33,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pcm/dsp.c,v 1.15 2007/06/14 21:48:36 corecode Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pcm/dsp.c,v 1.16 2007/10/08 17:55:00 hasso Exp $"); #define OLDPCM_IOCTL @@ -254,8 +254,6 @@ dsp_open(struct dev_open_args *ap) return error; } - if (flags & O_NONBLOCK) - rdch->flags |= CHN_F_NBIO; pcm_chnref(rdch, 1); CHN_UNLOCK(rdch); pcm_lock(d); @@ -287,8 +285,6 @@ dsp_open(struct dev_open_args *ap) return error; } - if (flags & O_NONBLOCK) - wrch->flags |= CHN_F_NBIO; pcm_chnref(wrch, 1); CHN_UNLOCK(wrch); pcm_lock(d); -- 2.41.0