https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=2654a5ba76de97f5211aa033fb1c7223a127e1b9
commit 2654a5ba76de97f5211aa033fb1c7223a127e1b9 Author: Takashi Yano <[email protected]> Date: Tue Sep 5 16:59:51 2023 +0900 Cygwin: dps: Fix a bug that read() could not return -1 on error. Diff: --- winsup/cygwin/fhandler/dsp.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler/dsp.cc b/winsup/cygwin/fhandler/dsp.cc index 8e51a51c5..e872aa08c 100644 --- a/winsup/cygwin/fhandler/dsp.cc +++ b/winsup/cygwin/fhandler/dsp.cc @@ -1192,7 +1192,9 @@ fhandler_dev_dsp::_read (void *ptr, size_t& len) return; } - audio_in_->read ((char *)ptr, (int&)len); + int res = len; + audio_in_->read ((char *)ptr, res); + len = (size_t)res; } void
