Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Fix return value. fo_kqfilter is expected to return...
details: https://anonhg.NetBSD.org/src/rev/9bcdd5bebb96
branches: trunk
changeset: 356933:9bcdd5bebb96
user: isaki <isaki%NetBSD.org@localhost>
date: Sat Oct 21 09:58:56 2017 +0000
description:
Fix return value. fo_kqfilter is expected to return errno on error.
This is the rest of 1.226 (10 years ago).
diffstat:
sys/dev/audio.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diffs (52 lines):
diff -r 1c31973cfb80 -r 9bcdd5bebb96 sys/dev/audio.c
--- a/sys/dev/audio.c Sat Oct 21 09:12:40 2017 +0000
+++ b/sys/dev/audio.c Sat Oct 21 09:58:56 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.412 2017/10/21 09:12:40 isaki Exp $ */
+/* $NetBSD: audio.c,v 1.413 2017/10/21 09:58:56 isaki 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.412 2017/10/21 09:12:40 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.413 2017/10/21 09:58:56 isaki Exp $");
#ifdef _KERNEL_OPT
#include "audio.h"
@@ -1903,8 +1903,8 @@
audiokqfilter(struct file *fp, struct knote *kn)
{
struct audio_softc *sc;
- int rv;
struct audio_chan *chan;
+ int error;
dev_t dev;
chan = fp->f_audioctx;
@@ -1922,18 +1922,19 @@
switch (AUDIODEV(dev)) {
case SOUND_DEVICE:
case AUDIO_DEVICE:
- rv = audio_kqfilter(chan, kn);
+ error = audio_kqfilter(chan, kn);
break;
case AUDIOCTL_DEVICE:
case MIXER_DEVICE:
- rv = 1;
+ error = ENODEV;
break;
default:
- rv = 1;
+ error = ENXIO;
+ break;
}
mutex_exit(sc->sc_lock);
- return rv;
+ return error;
}
static int
Home |
Main Index |
Thread Index |
Old Index