aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-12-14 19:11:42 +0000
committerChristopher Faylor <me@cgf.cx>2002-12-14 19:11:42 +0000
commit373c3857c2e62f045fe70eee97fd9035b03cabd7 (patch)
treec64930d36d8db92d3c5414639ff1760104aa64c7 /winsup/cygwin
parent3627f682fe535c3b04b1a3fc02637d2061e9e1c8 (diff)
downloadnewlib-373c3857c2e62f045fe70eee97fd9035b03cabd7.zip
newlib-373c3857c2e62f045fe70eee97fd9035b03cabd7.tar.gz
newlib-373c3857c2e62f045fe70eee97fd9035b03cabd7.tar.bz2
* fhandler.cc (fhandler_base::read): Signal event, if necessary, and raw_read
hasn't done so.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/fhandler.cc5
2 files changed, 10 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index a73b990..d932e9c 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2002-12-14 Christopher Faylor <cgf@redhat.com>
+ * fhandler.cc (fhandler_base::read): Signal event, if necessary, and
+ raw_read hasn't done so.
+
+2002-12-14 Christopher Faylor <cgf@redhat.com>
+
* fhandler.cc (fhandler_base::raw_read): Reset priorities to minimize
window where thread termination may cause data loss.
(fhandler_base::read): Always return at end of function. Just set len
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index a96f99c..f73b8ba 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -510,6 +510,7 @@ fhandler_base::read (void *in_ptr, size_t& len)
{
char *ptr = (char *) in_ptr;
ssize_t copied_chars = 0;
+ bool need_signal = !!read_state;
int c;
while (len)
@@ -534,6 +535,7 @@ fhandler_base::read (void *in_ptr, size_t& len)
}
raw_read (ptr + copied_chars, len);
+ need_signal = false;
if (!copied_chars)
/* nothing */;
else if ((ssize_t) len > 0)
@@ -601,6 +603,9 @@ fhandler_base::read (void *in_ptr, size_t& len)
#endif
out:
+ if (need_signal)
+ SetEvent (read_state);
+
debug_printf ("returning %d, %s mode", len,
get_r_binary () ? "binary" : "text");
return;