summaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-10-12 21:36:07 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-10-12 21:36:07 +0200
commitc30b727f51a9678663788810a4ab0eb4b18071d4 (patch)
tree46264b8aa40f71965d9c89fa48f7c91d7791528b /hurd
parentd7e1ec653f68a793f24cf4f02113bdc6e8b138b3 (diff)
Fix incorrect ready counting.
Using SELECT_ALL would make the fd counting thrice, and not only once per presence in select masks.
Diffstat (limited to 'hurd')
-rw-r--r--hurd/hurdselect.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/hurd/hurdselect.c b/hurd/hurdselect.c
index bb942429dd..95dfde059b 100644
--- a/hurd/hurdselect.c
+++ b/hurd/hurdselect.c
@@ -548,7 +548,15 @@ _hurd_select (int nfds,
readiness of the erring object and the next call hopefully
will get the error again. */
if (type & SELECT_ERROR)
- type = SELECT_ALL;
+ {
+ type = 0;
+ if (readfds != NULL && FD_ISSET (i, readfds))
+ type |= SELECT_READ;
+ if (writefds != NULL && FD_ISSET (i, writefds))
+ type |= SELECT_WRITE;
+ if (exceptfds != NULL && FD_ISSET (i, exceptfds))
+ type |= SELECT_URG;
+ }
if (type & SELECT_READ)
ready++;