* fhandler.h (fhandler_base::has_ongoing_io): Declare new function.

* fhandler.cc (fhandler_base::has_ongoing_io): Define new function.
(fhandler_base::read_overlapped): Use has_ongoing_io to avoid writing when
handle has not completed last I/O.
(fhandler_base::write_overlapped): Ditto.
* select.cc (peek_pipe): Be more careful about accessing hEvent field from
get_overlapped().
This commit is contained in:
Christopher Faylor
2009-06-28 19:23:13 +00:00
parent 91000b5d66
commit c81ceaefec
4 changed files with 60 additions and 19 deletions

View File

@ -513,7 +513,7 @@ out:
else if (fh->get_device () == FH_PIPER)
select_printf ("%s, select for write on read end of pipe",
fh->get_name ());
else if (fh->get_overlapped ()->hEvent
else if (fh->get_overlapped () && fh->get_overlapped ()->hEvent
&& WaitForSingleObject (fh->get_overlapped ()->hEvent, 0)
!= WAIT_OBJECT_0)
s->write_ready = false;