OSSP CVS Repository

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

Check-in Number: 4708
Date: 2004-Sep-12 14:18:22 (local)
2004-Sep-12 12:18:22 (UTC)
User:rse
Branch:
Comment: Internally handle errors returned from pth_event() in order to pass them upstream to the caller in pth_high.c functions.
Tickets:
Inspections:
Files:
ossp-pkg/pth/ChangeLog      1.622 -> 1.623     4 inserted, 0 deleted
ossp-pkg/pth/pth_high.c      1.107 -> 1.108     12 inserted, 6 deleted

ossp-pkg/pth/ChangeLog 1.622 -> 1.623

--- ChangeLog    2004/09/12 12:02:50     1.622
+++ ChangeLog    2004/09/12 12:18:22     1.623
@@ -21,6 +21,10 @@
                   
   Changes between 2.0.1 and 2.0.2 (13-Jul-2003 to 12-Sep-2004)
 
+   *) Internally handle errors returned from pth_event() in order
+      to pass them upstream to the caller in pth_high.c functions.
+      [Ralf S. Engelschall, NetBSD pkgsrc patches]
+
    *) Fix syscall wrapper for sendto(2).
       [NetBSD pkgsrc patches]
 


ossp-pkg/pth/pth_high.c 1.107 -> 1.108

--- pth_high.c   2004/09/12 11:52:33     1.107
+++ pth_high.c   2004/09/12 12:18:23     1.108
@@ -60,7 +60,8 @@
     pth_time_add(&until, &offset);
 
     /* and let thread sleep until this time is elapsed */
-    ev = pth_event(PTH_EVENT_TIME|PTH_MODE_STATIC, &ev_key, until);
+    if ((ev = pth_event(PTH_EVENT_TIME|PTH_MODE_STATIC, &ev_key, until)) == NULL)
+        return pth_error(-1, errno);
     pth_wait(ev);
 
     /* optionally provide amount of slept time */
@@ -92,7 +93,8 @@
     pth_time_add(&until, &offset);
 
     /* and let thread sleep until this time is elapsed */
-    ev = pth_event(PTH_EVENT_TIME|PTH_MODE_STATIC, &ev_key, until);
+    if ((ev = pth_event(PTH_EVENT_TIME|PTH_MODE_STATIC, &ev_key, until)) == NULL)
+        return pth_error(-1, errno);
     pth_wait(ev);
 
     return 0;
@@ -116,7 +118,8 @@
     pth_time_add(&until, &offset);
 
     /* and let thread sleep until this time is elapsed */
-    ev = pth_event(PTH_EVENT_TIME|PTH_MODE_STATIC, &ev_key, until);
+    if ((ev = pth_event(PTH_EVENT_TIME|PTH_MODE_STATIC, &ev_key, until)) == NULL)
+        return sec;
     pth_wait(ev);
 
     return 0;
@@ -166,7 +169,8 @@
     }
 
     /* create event and wait on it */
-    ev = pth_event(PTH_EVENT_SIGS|PTH_MODE_STATIC, &ev_key, set, sigp);
+    if ((ev = pth_event(PTH_EVENT_SIGS|PTH_MODE_STATIC, &ev_key, set, sigp)) == NULL)
+        return pth_error(errno, errno);
     if (ev_extra != NULL)
         pth_event_concat(ev, ev_extra, NULL);
     pth_wait(ev);
@@ -619,7 +623,8 @@
 
     /* if it is still on progress wait until socket is really writeable */
     if (rv == -1 && errno == EINPROGRESS && fdmode != PTH_FDMODE_NONBLOCK) {
-        ev = pth_event(PTH_EVENT_FD|PTH_UNTIL_FD_WRITEABLE|PTH_MODE_STATIC, &ev_key, s);
+        if ((ev = pth_event(PTH_EVENT_FD|PTH_UNTIL_FD_WRITEABLE|PTH_MODE_STATIC, &ev_key, s)) == NULL)
+            return pth_error(-1, errno);
         if (ev_extra != NULL)
             pth_event_concat(ev, ev_extra, NULL);
         pth_wait(ev);
@@ -672,7 +677,8 @@
            && fdmode != PTH_FDMODE_NONBLOCK) {
         /* do lazy event allocation */
         if (ev == NULL) {
-            ev = pth_event(PTH_EVENT_FD|PTH_UNTIL_FD_READABLE|PTH_MODE_STATIC, &ev_key, s);
+            if ((ev = pth_event(PTH_EVENT_FD|PTH_UNTIL_FD_READABLE|PTH_MODE_STATIC, &ev_key, s)) == NULL)
+                return pth_error(-1, errno);
             if (ev_extra != NULL)
                 pth_event_concat(ev, ev_extra, NULL);
         }

CVSTrac 2.0.1