From 2654a5ba76de97f5211aa033fb1c7223a127e1b9 Mon Sep 17 00:00:00 2001 From: Takashi Yano Date: Tue, 5 Sep 2023 16:59:51 +0900 Subject: Cygwin: dps: Fix a bug that read() could not return -1 on error. --- winsup/cygwin/fhandler/dsp.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'winsup') diff --git a/winsup/cygwin/fhandler/dsp.cc b/winsup/cygwin/fhandler/dsp.cc index 8e51a51..e872aa0 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 -- cgit v1.1