Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Explicitly set ioflag in audio_[read/write] IO_NDELA...
details: https://anonhg.NetBSD.org/src/rev/6161a8e26c1d
branches: trunk
changeset: 353372:6161a8e26c1d
user: nat <nat%NetBSD.org@localhost>
date: Tue May 02 06:25:05 2017 +0000
description:
Explicitly set ioflag in audio_[read/write] IO_NDELAY if O_NONBLOCK is set
in f_flags. This makes nonblocking reads and writes behave normally.
Addresses PR kern/52196.
diffstat:
sys/dev/audio.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diffs (38 lines):
diff -r 5c8132484d9f -r 6161a8e26c1d sys/dev/audio.c
--- a/sys/dev/audio.c Tue May 02 03:29:14 2017 +0000
+++ b/sys/dev/audio.c Tue May 02 06:25:05 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.329 2017/04/28 06:59:49 martin Exp $ */
+/* $NetBSD: audio.c,v 1.330 2017/05/02 06:25:05 nat Exp $ */
/*-
* Copyright (c) 2016 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -148,7 +148,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.329 2017/04/28 06:59:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.330 2017/05/02 06:25:05 nat Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -1661,6 +1661,9 @@
if ((error = audio_enter(dev, RW_READER, &sc)) != 0)
return error;
+ if (fp->f_flag & O_NONBLOCK)
+ ioflag |= IO_NDELAY;
+
switch (AUDIODEV(dev)) {
case SOUND_DEVICE:
case AUDIO_DEVICE:
@@ -1697,6 +1700,9 @@
if ((error = audio_enter(dev, RW_READER, &sc)) != 0)
return error;
+ if (fp->f_flag & O_NONBLOCK)
+ ioflag |= IO_NDELAY;
+
switch (AUDIODEV(dev)) {
case SOUND_DEVICE:
case AUDIO_DEVICE:
Home |
Main Index |
Thread Index |
Old Index