OSSP CVS Repository

ossp - Check-in [2744]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2744
Date: 2002-Nov-05 20:47:07 (local)
2002-Nov-05 19:47:07 (UTC)
User:rse
Branch:
Comment: use even more POSIX conforming semantics
Tickets:
Inspections:
Files:
ossp-pkg/pth/pth_high.c      1.95 -> 1.96     5 inserted, 1 deleted

ossp-pkg/pth/pth_high.c 1.95 -> 1.96

--- 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 (;;) {

CVSTrac 2.0.1