From c30b727f51a9678663788810a4ab0eb4b18071d4 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 12 Oct 2014 21:36:07 +0200 Subject: Fix incorrect ready counting. Using SELECT_ALL would make the fd counting thrice, and not only once per presence in select masks. --- hurd/hurdselect.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'hurd') 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++; -- cgit v1.2.3