From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id DE7FE3858C30; Tue, 5 Sep 2023 09:30:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE7FE3858C30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693906233; bh=p/BWZF5E1wuk1hYYiONlLf/dt1UQ9C4fFqZed8n5o2E=; h=From:To:Subject:Date:From; b=jSPgZAMVupGQ6QfTbjKIDfMkB6d+YJTLckgS19dR5b9uXbHz1HiQipv+Z0n+uOqkV 66GbQMLMx/W2dpK0nrmAR+pxI10Km1woBWGlbzq1w/ZoPyBjPMXqecyV147xFO8+vP VeiAK6G0LT3bAgM58IiPCSGpvCFHD4BTpuCi46LM= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Takashi Yano To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: dps: Fix a bug that read() could not return -1 on error. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: 2ab2e73c2c9602de98e218525d30149f0fb109ee X-Git-Newrev: 2654a5ba76de97f5211aa033fb1c7223a127e1b9 Message-Id: <20230905093033.DE7FE3858C30@sourceware.org> Date: Tue, 5 Sep 2023 09:30:33 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D2654a5ba76d= e97f5211aa033fb1c7223a127e1b9 commit 2654a5ba76de97f5211aa033fb1c7223a127e1b9 Author: Takashi Yano 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; } =20 - audio_in_->read ((char *)ptr, (int&)len); + int res =3D len; + audio_in_->read ((char *)ptr, res); + len =3D (size_t)res; } =20 void