Module Name:    src
Committed By:   isaki
Date:           Sat Oct 21 09:58:56 UTC 2017

Modified Files:
        src/sys/dev: audio.c

Log Message:
Fix return value.  fo_kqfilter is expected to return errno on error.
This is the rest of 1.226 (10 years ago).


To generate a diff of this commit:
cvs rdiff -u -r1.412 -r1.413 src/sys/dev/audio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/audio.c
diff -u src/sys/dev/audio.c:1.412 src/sys/dev/audio.c:1.413
--- src/sys/dev/audio.c:1.412	Sat Oct 21 09:12:40 2017
+++ src/sys/dev/audio.c	Sat Oct 21 09:58:56 2017
@@ -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 <nathanialsl...@yahoo.com.au>
@@ -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 @@ static int
 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 @@ audiokqfilter(struct file *fp, struct kn
 	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

Reply via email to