--- pth_high.c 2002/11/05 19:39:09 1.95
+++ pth_high.c 2002/11/05 19:47:07 1.96
@@ -719,10 +719,12 @@
delay.tv_usec = 0;
while ((n = pth_sc(select)(fd+1, &fds, NULL, NULL, &delay)) < 0
&& errno == EINTR) ;
+ if (n < 0 && (errno == EINVAL || errno == EBADF))
+ return pth_error(-1, errno);
/* if filedescriptor is still not readable,
let thread sleep until it is or the extra event occurs */
- if (n < 1) {
+ if (n == 0) {
ev = pth_event(PTH_EVENT_FD|PTH_UNTIL_FD_READABLE|PTH_MODE_STATIC, &ev_key, fd);
if (ev_extra != NULL)
pth_event_concat(ev, ev_extra, NULL);
@@ -789,6 +791,8 @@
delay.tv_usec = 0;
while ((n = pth_sc(select)(fd+1, NULL, &fds, NULL, &delay)) < 0
&& errno == EINTR) ;
+ if (n < 0 && (errno == EINVAL || errno == EBADF))
+ return pth_error(-1, errno);
rv = 0;
for (;;) {
|