diff options
| author | Julian Elischer <julian@FreeBSD.org> | 1996-08-20 08:22:01 +0000 |
|---|---|---|
| committer | Julian Elischer <julian@FreeBSD.org> | 1996-08-20 08:22:01 +0000 |
| commit | 0f7d684755aefbcfd70b45d24efc2d39bc505c4c (patch) | |
| tree | b14348030d1048f8628b798374a8a061a990aae3 /lib/libpthread/thread/thr_select.c | |
| parent | 1bbb22c82e47dbc805e523be5e2fe3d4436761e0 (diff) | |
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_select.c')
| -rw-r--r-- | lib/libpthread/thread/thr_select.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/lib/libpthread/thread/thr_select.c b/lib/libpthread/thread/thr_select.c index b3f548373e99..7db3ed2f2444 100644 --- a/lib/libpthread/thread/thr_select.c +++ b/lib/libpthread/thread/thr_select.c @@ -142,36 +142,29 @@ select(int numfds, fd_set * readfds, fd_set * writefds, if (ret > 0) { if (readfds != NULL) { - FD_ZERO(readfds); for (i = 0; i < numfds; i++) { - if (FD_ISSET(i, &data.readfds)) { - FD_SET(i, readfds); + if (FD_ISSET(i, readfds) && + !FD_ISSET(i, &data.readfds)) { + FD_CLR(i, readfds); } } } if (writefds != NULL) { - FD_ZERO(writefds); for (i = 0; i < numfds; i++) { - if (FD_ISSET(i, &data.writefds)) { - FD_SET(i, writefds); + if (FD_ISSET(i, writefds) && + !FD_ISSET(i, &data.writefds)) { + FD_CLR(i, writefds); } } } if (exceptfds != NULL) { - FD_ZERO(exceptfds); for (i = 0; i < numfds; i++) { - if (FD_ISSET(i, &data.exceptfds)) { - FD_SET(i, exceptfds); + if (FD_ISSET(i, exceptfds) && + !FD_ISSET(i, &data.exceptfds)) { + FD_CLR(i, exceptfds); } } } - } else { - if (exceptfds != NULL) - FD_ZERO(exceptfds); - if (writefds != NULL) - FD_ZERO(writefds); - if (readfds != NULL) - FD_ZERO(readfds); } return (ret); |
