From 623aea3134a4e4b98e2893b8e3ae517ecad45a08 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Thu, 22 Apr 2010 20:17:02 +0200
Subject: [PATCH] test536: do not fail with threaded DNS resolver

Suggested by Constantine Sapuntzakis.
---
 tests/libtest/lib536.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/libtest/lib536.c b/tests/libtest/lib536.c
index 04bc696..2850104 100644
--- a/tests/libtest/lib536.c
+++ b/tests/libtest/lib536.c
@@ -31,6 +31,10 @@ static CURLMcode perform(CURLM * multi)
   mp_start = tutil_tvnow();
 
   for (;;) {
+    struct timeval timeout;
+    timeout.tv_sec = 0;
+    timeout.tv_usec = 100000L; /* 100 ms */
+
     code = curl_multi_perform(multi, &handles);
     if (tutil_tvdiff(tutil_tvnow(), mp_start) >
         MULTI_PERFORM_HANG_TIMEOUT) {
@@ -53,9 +57,7 @@ static CURLMcode perform(CURLM * multi)
     FD_ZERO(&fdwrite);
     FD_ZERO(&fdexcep);
     curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd);
-    if (maxfd < 0)
-      return (CURLMcode) ~CURLM_OK;
-    if (select(maxfd + 1, &fdread, &fdwrite, &fdexcep, 0) == -1)
+    if (select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout) == -1)
       return (CURLMcode) ~CURLM_OK;
   }
 
-- 
1.6.6.1


