Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libossaudio ossaudio(3): return correctly initialized re...



details:   https://anonhg.NetBSD.org/src/rev/5d2358d366b2
branches:  trunk
changeset: 977860:5d2358d366b2
user:      nia <nia%NetBSD.org@localhost>
date:      Tue Nov 03 08:24:33 2020 +0000

description:
ossaudio(3): return correctly initialized return value in unlikely
error case. pointed out by tnn.

diffstat:

 lib/libossaudio/ossaudio.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r 05885286e8d6 -r 5d2358d366b2 lib/libossaudio/ossaudio.c
--- a/lib/libossaudio/ossaudio.c        Mon Nov 02 22:59:48 2020 +0000
+++ b/lib/libossaudio/ossaudio.c        Tue Nov 03 08:24:33 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ossaudio.c,v 1.59 2020/10/30 21:44:49 nia Exp $        */
+/*     $NetBSD: ossaudio.c,v 1.60 2020/11/03 08:24:33 nia Exp $        */
 
 /*-
  * Copyright (c) 1997, 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: ossaudio.c,v 1.59 2020/10/30 21:44:49 nia Exp $");
+__RCSID("$NetBSD: ossaudio.c,v 1.60 2020/11/03 08:24:33 nia Exp $");
 
 /*
  * This is an Open Sound System compatibility layer, which provides
@@ -187,9 +187,9 @@
                        INTARG = 192000;
                tmpinfo.play.sample_rate =
                tmpinfo.record.sample_rate = INTARG;
-               if (ioctl(fd, AUDIO_SETINFO, &tmpinfo) < 0) {
+               retval = ioctl(fd, AUDIO_SETINFO, &tmpinfo);
+               if (retval < 0)
                        return retval;
-               }
                /* FALLTHRU */
        case SOUND_PCM_READ_RATE:
                retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);



Home | Main Index | Thread Index | Old Index