Index: ossp-pkg/pth/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/pth/ChangeLog,v rcsdiff -q -kk '-r1.588' '-r1.589' -u '/v/ossp/cvs/ossp-pkg/pth/ChangeLog,v' 2>/dev/null --- ChangeLog 2002/11/05 19:39:08 1.588 +++ ChangeLog 2002/11/07 15:21:06 1.589 @@ -21,6 +21,9 @@ Changes between 1.4.1 and 1.5.0 (27-Jan-2002 to xx-Nov-2002) + *) Check for PTH_FDMODE_ERROR error conditions internally, too. + [Ralf S. Engelschall] + *) Use the new PTH_STATUS_FAILED event status in the scheduler's event-manager for filedescriptor events if the internal select(2) call returned with an error. Additionally this PTH_STATUS_FAILED Index: ossp-pkg/pth/pth_high.c RCS File: /v/ossp/cvs/ossp-pkg/pth/pth_high.c,v rcsdiff -q -kk '-r1.98' '-r1.99' -u '/v/ossp/cvs/ossp-pkg/pth/pth_high.c,v' 2>/dev/null --- pth_high.c 2002/11/07 15:07:54 1.98 +++ pth_high.c 2002/11/07 15:21:06 1.99 @@ -698,6 +698,7 @@ pth_event_t ev; static pth_key_t ev_key = PTH_KEY_INIT; fd_set fds; + int fdmode; int n; pth_implicit_init(); @@ -709,8 +710,12 @@ if (!pth_util_fd_valid(fd)) return pth_error(-1, EBADF); + /* check mode of filedescriptor */ + if ((fdmode = pth_fdmode(fd, PTH_FDMODE_POLL)) == PTH_FDMODE_ERROR) + return pth_error(-1, EBADF); + /* poll filedescriptor if not already in non-blocking operation */ - if (pth_fdmode(fd, PTH_FDMODE_POLL) == PTH_FDMODE_BLOCK) { + if (fdmode == PTH_FDMODE_BLOCK) { /* now directly poll filedescriptor for readability to avoid unneccessary (and resource consuming because of context @@ -865,6 +870,7 @@ pth_event_t ev; static pth_key_t ev_key = PTH_KEY_INIT; fd_set fds; + int fdmode; int n; pth_implicit_init(); @@ -876,8 +882,12 @@ if (!pth_util_fd_valid(fd)) return pth_error(-1, EBADF); + /* check mode of filedescriptor */ + if ((fdmode = pth_fdmode(fd, PTH_FDMODE_POLL)) == PTH_FDMODE_ERROR) + return pth_error(-1, EBADF); + /* poll filedescriptor if not already in non-blocking operation */ - if (pth_fdmode(fd, PTH_FDMODE_POLL) == PTH_FDMODE_BLOCK) { + if (fdmode == PTH_FDMODE_BLOCK) { /* first directly poll filedescriptor for readability to avoid unneccessary (and resource consuming because of context @@ -1289,6 +1299,7 @@ pth_event_t ev; static pth_key_t ev_key = PTH_KEY_INIT; fd_set fds; + int fdmode; int n; pth_implicit_init(); @@ -1300,8 +1311,12 @@ if (!pth_util_fd_valid(fd)) return pth_error(-1, EBADF); + /* check mode of filedescriptor */ + if ((fdmode = pth_fdmode(fd, PTH_FDMODE_POLL)) == PTH_FDMODE_ERROR) + return pth_error(-1, EBADF); + /* poll filedescriptor if not already in non-blocking operation */ - if (pth_fdmode(fd, PTH_FDMODE_POLL) == PTH_FDMODE_BLOCK) { + if (fdmode == PTH_FDMODE_BLOCK) { /* now directly poll filedescriptor for readability to avoid unneccessary (and resource consuming because of context