OSSP CVS Repository

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

Check-in Number: 2755
Date: 2002-Nov-07 14:27:56 (local)
2002-Nov-07 13:27:56 (UTC)
User:rse
Branch:
Comment: more POSIX conformance for pth_send/pth_recv
Tickets:
Inspections:
Files:
ossp-pkg/pth/pth_high.c      1.96 -> 1.97     6 inserted, 2 deleted

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

--- pth_high.c   2002/11/05 19:47:07     1.96
+++ pth_high.c   2002/11/07 13:27:56     1.97
@@ -1310,10 +1310,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);
@@ -1396,12 +1398,14 @@
         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 (;;) {
             /* if filedescriptor is still not writeable,
                let thread sleep until it is or event occurs */
-            if (n < 1) {
+            if (n == 0) {
                 ev = pth_event(PTH_EVENT_FD|PTH_UNTIL_FD_WRITEABLE|PTH_MODE_STATIC, &ev_key, fd);
                 if (ev_extra != NULL)
                     pth_event_concat(ev, ev_extra, NULL);

CVSTrac 2.0.1