X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fconnect.cc;h=5e6c77f568a44b07c2dcc68ecb4e9163a2eee5fa;hb=9fd31c03436acf24c593dc3a77c905eb137ef570;hp=77cfb3bd2e7c4b809537bb45f0bf871a80925f79;hpb=28adf7b936c6f5c25b7526ff56ec1256da1246d4;p=awesomized%2Flibmemcached diff --git a/libmemcached/connect.cc b/libmemcached/connect.cc index 77cfb3bd..5e6c77f5 100644 --- a/libmemcached/connect.cc +++ b/libmemcached/connect.cc @@ -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: