summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-01-26 09:32:49 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-01-26 09:44:25 +0100
commitc5040bb4dd2dee1688aef6eb081b284e3854678f (patch)
tree60f789533e3eb0c083102b2a4192c1abb0666bfb
parent782143ee818ca26d3da9133733eb97949346a88b (diff)
downloadcurl-bagder/our-select.tar.gz
select: convert Curl_select() to private static functionbagder/our-select
It old funciton should not be used anywhere anymore (the only remaining gskit use has to be fixed to instead use Curl_poll). The static function version is now called our_select() and is only built if necessary.
-rw-r--r--lib/select.c17
-rw-r--r--lib/select.h8
2 files changed, 11 insertions, 14 deletions
diff --git a/lib/select.c b/lib/select.c
index 7d1f944cd..d7346b195 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;
diff --git a/lib/select.h b/lib/select.h
index 135095043..4db64877b 100644
--- a/lib/select.h
+++ b/lib/select.h
@@ -7,7 +7,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
@@ -72,12 +72,6 @@ struct pollfd
therefore defined here */
#define CURL_CSELECT_IN2 (CURL_CSELECT_ERR << 1)
-int Curl_select(curl_socket_t maxfd,
- fd_set *fds_read,
- fd_set *fds_write,
- fd_set *fds_err,
- timediff_t timeout_ms);
-
int Curl_socket_check(curl_socket_t readfd, curl_socket_t readfd2,
curl_socket_t writefd,
timediff_t timeout_ms);