Index: ossp-pkg/pth/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/pth/ChangeLog,v rcsdiff -q -kk '-r1.622' '-r1.623' -u '/v/ossp/cvs/ossp-pkg/pth/ChangeLog,v' 2>/dev/null --- 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] Index: ossp-pkg/pth/pth_high.c RCS File: /v/ossp/cvs/ossp-pkg/pth/pth_high.c,v rcsdiff -q -kk '-r1.107' '-r1.108' -u '/v/ossp/cvs/ossp-pkg/pth/pth_high.c,v' 2>/dev/null --- 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); }