public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH 1/3] Cygwin: dps: Fix a bug that read() could not return -1 on error.
@ 2023-09-05  9:28 Takashi Yano
  2023-09-05  9:28 ` [PATCH 2/3] Cygwin: dsp: Reduce wait time for blocking read() Takashi Yano
  2023-09-05  9:28 ` [PATCH 3/3] Cygwin: dsp: Fix trivial editorial issue Takashi Yano
  0 siblings, 2 replies; 3+ messages in thread
From: Takashi Yano @ 2023-09-05  9:28 UTC (permalink / raw)
  To: cygwin-patches; +Cc: Takashi Yano

---
 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
-- 
2.39.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/3] Cygwin: dsp: Reduce wait time for blocking read().
  2023-09-05  9:28 [PATCH 1/3] Cygwin: dps: Fix a bug that read() could not return -1 on error Takashi Yano
@ 2023-09-05  9:28 ` Takashi Yano
  2023-09-05  9:28 ` [PATCH 3/3] Cygwin: dsp: Fix trivial editorial issue Takashi Yano
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Yano @ 2023-09-05  9:28 UTC (permalink / raw)
  To: cygwin-patches; +Cc: Takashi Yano

Previous wait time of 100msec is too long if application specifies
smaller buffer. With this patch, the wait time is reduced to 1msec.
---
 winsup/cygwin/fhandler/dsp.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler/dsp.cc b/winsup/cygwin/fhandler/dsp.cc
index e872aa08c..00f2bab69 100644
--- a/winsup/cygwin/fhandler/dsp.cc
+++ b/winsup/cygwin/fhandler/dsp.cc
@@ -931,8 +931,8 @@ fhandler_dev_dsp::Audio_in::waitfordata ()
 	  set_errno (EAGAIN);
 	  return false;
 	}
-      debug_printf ("100ms");
-      switch (cygwait (100))
+      debug_printf ("1ms");
+      switch (cygwait (1))
 	{
 	case WAIT_SIGNALED:
 	  if (!_my_tls.call_signal_handler ())
-- 
2.39.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 3/3] Cygwin: dsp: Fix trivial editorial issue.
  2023-09-05  9:28 [PATCH 1/3] Cygwin: dps: Fix a bug that read() could not return -1 on error Takashi Yano
  2023-09-05  9:28 ` [PATCH 2/3] Cygwin: dsp: Reduce wait time for blocking read() Takashi Yano
@ 2023-09-05  9:28 ` Takashi Yano
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Yano @ 2023-09-05  9:28 UTC (permalink / raw)
  To: cygwin-patches; +Cc: Takashi Yano

---
 winsup/cygwin/fhandler/dsp.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/fhandler/dsp.cc b/winsup/cygwin/fhandler/dsp.cc
index 00f2bab69..861443352 100644
--- a/winsup/cygwin/fhandler/dsp.cc
+++ b/winsup/cygwin/fhandler/dsp.cc
@@ -1029,7 +1029,7 @@ fhandler_dev_dsp::write (const void *ptr, size_t len)
 void
 fhandler_dev_dsp::read (void *ptr, size_t& len)
 {
-  return base ()->_read (ptr, len);
+  base ()->_read (ptr, len);
 }
 
 int
-- 
2.39.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-05  9:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-05  9:28 [PATCH 1/3] Cygwin: dps: Fix a bug that read() could not return -1 on error Takashi Yano
2023-09-05  9:28 ` [PATCH 2/3] Cygwin: dsp: Reduce wait time for blocking read() Takashi Yano
2023-09-05  9:28 ` [PATCH 3/3] Cygwin: dsp: Fix trivial editorial issue Takashi Yano

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).