diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 45602de70..c342f058b 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2003-04-22 Christopher Faylor + + * select.cc (fhandler_pipe::ready_for_read): Assure that get_guard is + called for successful non-blocking pipe reads. + 2003-04-22 Corinna Vinschen * include/inttypes.h: New file. diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 1a9069626..100d6f263 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -586,11 +586,15 @@ pipe_cleanup (select_record *, select_stuff *stuff) int fhandler_pipe::ready_for_read (int fd, DWORD howlong) { - if (!howlong) - return fhandler_base::ready_for_read (fd, howlong); + int res; + if (howlong) + res = true; + else + res = fhandler_base::ready_for_read (fd, howlong); - get_guard (); - return true; + if (res) + get_guard (); + return res; } select_record *