public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/cygwin-3_4-branch] Cygwin: dsp: Fix a few trivial bugs.
@ 2023-09-01 10:06 Takashi Yano
  0 siblings, 0 replies; only message in thread
From: Takashi Yano @ 2023-09-01 10:06 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=930f210b21c59298944f237002c36db0b990a4d9

commit 930f210b21c59298944f237002c36db0b990a4d9
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Fri Sep 1 11:32:51 2023 +0900

    Cygwin: dsp: Fix a few trivial bugs.
    
    Signed-off-by: Takashi Yano <takashi.yanao@nifty.ne.jp>

Diff:
---
 winsup/cygwin/fhandler/dsp.cc           | 4 ++--
 winsup/cygwin/local_includes/fhandler.h | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler/dsp.cc b/winsup/cygwin/fhandler/dsp.cc
index db7b2550e..d930328ce 100644
--- a/winsup/cygwin/fhandler/dsp.cc
+++ b/winsup/cygwin/fhandler/dsp.cc
@@ -1062,7 +1062,7 @@ fhandler_dev_dsp::fixup_after_exec ()
 int
 fhandler_dev_dsp::open (int flags, mode_t)
 {
-  int ret = 0, err = 0;
+  int ret = -1, err = 0;
   UINT num_in = 0, num_out = 0;
   set_flags ((flags & ~O_TEXT) | O_BINARY);
   // Work out initial sample format & frequency, /dev/dsp defaults
@@ -1095,7 +1095,7 @@ fhandler_dev_dsp::open (int flags, mode_t)
 
   debug_printf ("ACCMODE=%y audio_in=%d audio_out=%d, err=%d, ret=%d",
 		flags & O_ACCMODE, num_in, num_out, err, ret);
-  if (ret)
+  if (ret >= 0)
     being_closed = false;
   return ret;
 }
diff --git a/winsup/cygwin/local_includes/fhandler.h b/winsup/cygwin/local_includes/fhandler.h
index abff2e08f..649a43184 100644
--- a/winsup/cygwin/local_includes/fhandler.h
+++ b/winsup/cygwin/local_includes/fhandler.h
@@ -2791,6 +2791,8 @@ class fhandler_dev_dsp: public fhandler_base
 
   void close_audio_in ();
   void close_audio_out (bool = false);
+
+ public:
   bool use_archetype () const {return true;}
 
   fhandler_dev_dsp (void *) {}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-01 10:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-01 10:06 [newlib-cygwin/cygwin-3_4-branch] Cygwin: dsp: Fix a few trivial bugs Takashi Yano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).