Skip to content

Commit

Permalink
Cygwin: dsp: Fix a few trivial bugs.
Browse files Browse the repository at this point in the history
Signed-off-by: Takashi Yano <[email protected]>
  • Loading branch information
tyan0 committed Sep 1, 2023
1 parent 31eb43e commit cc4ff71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions winsup/cygwin/fhandler/dsp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions winsup/cygwin/local_includes/fhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *) {}
Expand Down

0 comments on commit cc4ff71

Please sign in to comment.