public inbox for cygwin-cvs@sourceware.org help / color / mirror / Atom feed
From: Takashi Yano <tyan0@sourceware.org> To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: dsp: Fix a few trivial bugs. Date: Fri, 1 Sep 2023 10:06:58 +0000 (GMT) [thread overview] Message-ID: <20230901100658.0E88B3858C66@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=cc4ff714ff4b59d8ecac90ddc45196a0ea74e22b commit cc4ff714ff4b59d8ecac90ddc45196a0ea74e22b 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 27f0a50ce..8e51a51c5 100644 --- a/winsup/cygwin/fhandler/dsp.cc +++ b/winsup/cygwin/fhandler/dsp.cc @@ -1060,7 +1060,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 9af5f716c..098b8dd19 100644 --- a/winsup/cygwin/local_includes/fhandler.h +++ b/winsup/cygwin/local_includes/fhandler.h @@ -2817,6 +2817,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 *) {}
reply other threads:[~2023-09-01 10:06 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230901100658.0E88B3858C66@sourceware.org \ --to=tyan0@sourceware.org \ --cc=cygwin-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).