summaryrefslogtreecommitdiff
path: root/src/libc/select.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libc/select.c')
-rw-r--r--src/libc/select.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libc/select.c b/src/libc/select.c
index e3e95e4..20f7b71 100644
--- a/src/libc/select.c
+++ b/src/libc/select.c
@@ -21,6 +21,12 @@ select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct ti
(void)timeout;
FD_ZERO(exceptfds);
if (countset(nfds, readfds) != 0) {
+ if (countset(nfds, readfds) == 1 && countset(nfds, writefds) == 0) {
+ /* special case: if you're only waiting for a single fd to become
+ * readable, just go ahead and read() it.
+ * curl compat. */
+ return 1;
+ }
return errno = ENOSYS, -1;
}
return countset(nfds, writefds); /* assume everything is ready for writing */