--- 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);
}
|