Skip to content

Commit

Permalink
Fix select() return code for fd >= 1024 (yhirose#1757)
Browse files Browse the repository at this point in the history
(cherry picked from commit af2928d)
  • Loading branch information
jfsimoneau authored and zkx committed Oct 10, 2024
1 parent 6e76792 commit bd7200b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions httplib.h
Original file line number Diff line number Diff line change
Expand Up @@ -2792,7 +2792,7 @@ inline ssize_t select_read(socket_t sock, time_t sec, time_t usec) {
return handle_EINTR([&]() { return poll(&pfd_read, 1, timeout); });
#else
#ifndef _WIN32
if (sock >= FD_SETSIZE) { return 1; }
if (sock >= FD_SETSIZE) { return -1; }
#endif

fd_set fds;
Expand Down Expand Up @@ -2820,7 +2820,7 @@ inline ssize_t select_write(socket_t sock, time_t sec, time_t usec) {
return handle_EINTR([&]() { return poll(&pfd_read, 1, timeout); });
#else
#ifndef _WIN32
if (sock >= FD_SETSIZE) { return 1; }
if (sock >= FD_SETSIZE) { return -1; }
#endif

fd_set fds;
Expand Down

0 comments on commit bd7200b

Please sign in to comment.