Merge in code such that we are much closer to running the same test
[m6w6/libmemcached] / libmemcached / connect.cc
index 77cfb3bd2e7c4b809537bb45f0bf871a80925f79..5e6c77f568a44b07c2dcc68ecb4e9163a2eee5fa 100644 (file)
@@ -49,18 +49,14 @@ static memcached_return_t connect_poll(memcached_server_st *ptr)
 
   size_t loop_max= 5;
 
-  while (--loop_max) // Should only loop on cases of ERESTART or EINTR
+  if (ptr->root->poll_timeout == 0)
   {
-    int error;
-    if (ptr->root->poll_timeout)
-    {
-      error= poll(fds, 1, ptr->root->connect_timeout);
-    }
-    else
-    {
-      error= 0;
-    }
+    return memcached_set_error(*ptr, MEMCACHED_TIMEOUT, MEMCACHED_AT);
+  }
 
+  while (--loop_max) // Should only loop on cases of ERESTART or EINTR
+  {
+    int error= poll(fds, 1, ptr->root->connect_timeout);
     switch (error)
     {
     case 1: