ossp-pkg/pth/pth_high.c 1.91 -> 1.92
--- pth_high.c 2002/10/24 15:21:13 1.91
+++ pth_high.c 2002/10/25 11:53:28 1.92
@@ -300,6 +300,13 @@
/* POSIX compliance */
if (nfd < 0 || nfd > FD_SETSIZE)
return pth_error(-1, EINVAL);
+ if (timeout != NULL) {
+ if ( timeout->tv_sec < 0
+ || timeout->tv_sec > 100000000 /* about 3 years */
+ || timeout->tv_usec < 0
+ || timeout->tv_usec >= 1000000 /* a full second */)
+ return pth_error(-1, EINVAL);
+ }
/* first deal with the special situation of a plain microsecond delay */
if (nfd == 0 && rfds == NULL && wfds == NULL && efds == NULL && timeout != NULL) {
@@ -371,6 +378,8 @@
return 0;
}
}
+ if (rc < 0 && errno == EBADF)
+ return pth_error(-1, EBADF);
/* suspend current thread until one fd is ready or the timeout occurred */
rc = -1;
|
|