diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index bc02c3f9d4..2c09b14d1c 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -776,7 +776,7 @@ peek_pipe (select_record *s, bool from_select) } ssize_t n = pipe_data_available (s->fd, fh, h, PDA_SELECT | PDA_WRITE); select_printf ("write: %s, n %d", fh->get_name (), n); - gotone += s->write_ready = (n >= PIPE_BUF); + gotone += s->write_ready = (n > 0); if (n < 0 && s->except_selected) gotone += s->except_ready = true; } @@ -990,7 +990,7 @@ peek_fifo (select_record *s, bool from_select) ssize_t n = pipe_data_available (s->fd, fh, fh->get_handle (), PDA_SELECT | PDA_WRITE); select_printf ("write: %s, n %d", fh->get_name (), n); - gotone += s->write_ready = (n >= PIPE_BUF); + gotone += s->write_ready = (n > 0); if (n < 0 && s->except_selected) gotone += s->except_ready = true; } @@ -1416,7 +1416,7 @@ peek_pty_slave (select_record *s, bool from_select) { ssize_t n = pipe_data_available (s->fd, fh, h, PDA_SELECT | PDA_WRITE); select_printf ("write: %s, n %d", fh->get_name (), n); - gotone += s->write_ready = (n >= PIPE_BUF); + gotone += s->write_ready = (n > 0); if (n < 0 && s->except_selected) gotone += s->except_ready = true; }