2011-12-08 Christopher Faylor <me.cygwin2011@cgf.cx>
+ * select.cc (cygwin_select): Make sure that 0 is returned when sel.wait
+ times out.
+
+2011-12-08 Christopher Faylor <me.cygwin2011@cgf.cx>
+
* include/sys/wait.h: Add in all c++ functions.
2011-12-08 Christopher Faylor <me.cygwin2011@cgf.cx>
break;
}
else if ((sel.always_ready || ms == 0)
- || (res = sel.wait (r, w, e, ms)) == 0)
+ || (res = sel.wait (r, w, e, ms)) >= 0)
{
copyfd_set (readfds, r, maxfds);
copyfd_set (writefds, w, maxfds);
copyfd_set (exceptfds, e, maxfds);
- res = sel.poll (readfds, writefds, exceptfds);
+ res = (res > 0) ? 0 : sel.poll (readfds, writefds, exceptfds);
}
syscall_printf ("%R = select (%d, %p, %p, %p, %p)", res, maxfds, readfds,