fds.fd= ptr->fd;
fds.events= POLLIN;
- int error;
-
if (read_or_write == MEM_WRITE) /* write */
{
fds.events= POLLOUT;
}
}
+ if (ptr->root->poll_timeout == 0) // Mimic 0 causes timeout behavior (not all platforms do this)
+ {
+ return memcached_set_error(*ptr, MEMCACHED_TIMEOUT, MEMCACHED_AT);
+ }
+
size_t loop_max= 5;
while (--loop_max) // While loop is for ERESTART or EINTR
{
- if (ptr->root->poll_timeout) // Mimic 0 causes timeout behavior (not all platforms do this)
- {
- error= poll(&fds, 1, ptr->root->poll_timeout);
- }
- else
- {
- error= 0;
- }
+ int error= poll(&fds, 1, ptr->root->poll_timeout);
switch (error)
{
case 1: // Success!
}
}
- /* Imposssible for anything other then -1 */
- WATCHPOINT_ASSERT(error == -1);
ptr->cached_errno= get_socket_errno();
memcached_quit_server(ptr, true);
return NULL;
}
- switch (poll(fds, host_index, memc->poll_timeout))
+ int error= poll(fds, host_index, memc->poll_timeout);
+ switch (error)
{
case -1:
memcached_set_errno(*memc, get_socket_errno(), MEMCACHED_AT);