Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index a96f99c69..f73b8baf4 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;