diff options
author | Curl Upstream <curl-library@cool.haxx.se> | 2021-02-03 07:02:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-02-03 16:49:32 (GMT) |
commit | 076b3219f58ca16afa52fe095019a05537ade0f3 (patch) | |
tree | f9ea493f94ce5afb8792e1ab4a040cea7eba4aed /lib/select.c | |
parent | 5aacc593a961fe9ee1427c03d18fba8947a9e33d (diff) | |
download | CMake-076b3219f58ca16afa52fe095019a05537ade0f3.zip CMake-076b3219f58ca16afa52fe095019a05537ade0f3.tar.gz CMake-076b3219f58ca16afa52fe095019a05537ade0f3.tar.bz2 |
curl 2021-02-03 (2f33be81)
Code extracted from:
https://github.com/curl/curl.git
at commit 2f33be817cbce6ad7a36f27dd7ada9219f13584c (curl-7_75_0).
Diffstat (limited to 'lib/select.c')
-rw-r--r-- | lib/select.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/select.c b/lib/select.c index 7d1f944..d7346b1 100644 --- a/lib/select.c +++ b/lib/select.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -130,6 +130,7 @@ int Curl_wait_ms(timediff_t timeout_ms) return r; } +#ifndef HAVE_POLL_FINE /* * This is a wrapper around select() to aid in Windows compatibility. * A negative timeout value makes this function wait indefinitely, @@ -141,11 +142,11 @@ int Curl_wait_ms(timediff_t timeout_ms) * 0 = timeout * N = number of signalled file descriptors */ -int Curl_select(curl_socket_t maxfd, /* highest socket number */ - fd_set *fds_read, /* sockets ready for reading */ - fd_set *fds_write, /* sockets ready for writing */ - fd_set *fds_err, /* sockets with errors */ - timediff_t timeout_ms) /* milliseconds to wait */ +static int our_select(curl_socket_t maxfd, /* highest socket number */ + fd_set *fds_read, /* sockets ready for reading */ + fd_set *fds_write, /* sockets ready for writing */ + fd_set *fds_err, /* sockets with errors */ + timediff_t timeout_ms) /* milliseconds to wait */ { struct timeval pending_tv; struct timeval *ptimeout; @@ -220,6 +221,8 @@ int Curl_select(curl_socket_t maxfd, /* highest socket number */ #endif } +#endif + /* * Wait for read or write events on a set of file descriptors. It uses poll() * when a fine poll() is available, in order to avoid limits with FD_SETSIZE, @@ -412,7 +415,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms) curl_socket_t is unsigned in such cases and thus -1 is the largest value). */ - r = Curl_select(maxfd, &fds_read, &fds_write, &fds_err, timeout_ms); + r = our_select(maxfd, &fds_read, &fds_write, &fds_err, timeout_ms); if(r <= 0) return r; |