aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/first.c
diff options
context:
space:
mode:
authorGisle Vanem <gvanem@broadpark.no>2006-09-10 19:01:04 +0000
committerGisle Vanem <gvanem@broadpark.no>2006-09-10 19:01:04 +0000
commite134a4020885701b583b8af2e9d0414b090512f6 (patch)
treeb93c895fb130564d17bce96d13c73b63edb7918a /tests/libtest/first.c
parent690888cfc107c16980785195ca9e05acba51593a (diff)
Added select_test() function to allow selecting on no sockets on
Winsock.
Diffstat (limited to 'tests/libtest/first.c')
-rw-r--r--tests/libtest/first.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/libtest/first.c b/tests/libtest/first.c
index a7f317355..fda1a7fb5 100644
--- a/tests/libtest/first.c
+++ b/tests/libtest/first.c
@@ -9,6 +9,21 @@ extern void curl_memlimit(int);
/* test is provided in the test code file */
int test(char *url);
+int select_test (int num_fds, fd_set *rd, fd_set *wr, fd_set *exc,
+ struct timeval *tv)
+{
+#ifdef WIN32
+ /* Winsock doesn't like no socket set in 'rd', 'wr' or 'exc'. This is
+ * case when 'num_fds <= 0. So sleep.
+ */
+ if (num_fds <= 0) {
+ Sleep(1000*tv->tv_sec + tv->tv_usec/1000);
+ return 0;
+ }
+#endif
+ return select(num_fds, rd, wr, exc, tv);
+}
+
char *arg2=NULL;
int main(int argc, char **argv)