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: dps: Fix a bug that read() could not return -1 on error.
Date: Tue,  5 Sep 2023 09:30:33 +0000 (GMT)	[thread overview]
Message-ID: <20230905093033.DE7FE3858C30@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=2654a5ba76de97f5211aa033fb1c7223a127e1b9

commit 2654a5ba76de97f5211aa033fb1c7223a127e1b9
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
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

                 reply	other threads:[~2023-09-05  9:30 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=20230905093033.DE7FE3858C30@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: link
Be 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).