* 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:
@ -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;
|
||||
|
Reference in New Issue
Block a user