if (ptr->root->flags.no_block == false)
timeout= -1;
- while (1)
+ size_t loop_max= 5;
+ while (--loop_max)
{
error= poll(&fds, 1, timeout);
return MEMCACHED_SUCCESS;
case 0:
return MEMCACHED_TIMEOUT;
+#ifdef TARGET_OS_LINUX
case ERESTART:
+#endif
case EINTR:
continue;
default:
ptr->cached_errno= error;
- memcached_quit_server(ptr, 1);
+ memcached_quit_server(ptr, true);
return MEMCACHED_FAILURE;
}
/* Imposssible for anything other then -1 */
WATCHPOINT_ASSERT(error == -1);
ptr->cached_errno= error;
- memcached_quit_server(ptr, 1);
+ memcached_quit_server(ptr, true);
return MEMCACHED_FAILURE;
}
{
case EAGAIN:
case EINTR:
+#ifdef TARGET_OS_LINUX
case ERESTART:
+#endif
if ((rc= io_wait(ptr, MEM_READ)) == MEMCACHED_SUCCESS)
continue;
/* fall through */
default:
{
- memcached_quit_server(ptr, 1);
+ memcached_quit_server(ptr, true);
*nread= -1;
return rc;
}
for blocking I/O we do not return 0 and for non-blocking case
it will return EGAIN if data is not immediatly available.
*/
- memcached_quit_server(ptr, 1);
+ memcached_quit_server(ptr, true);
*nread= -1;
return MEMCACHED_UNKNOWN_READ_FAILURE;
}
if (rc == MEMCACHED_SUCCESS || rc == MEMCACHED_TIMEOUT)
continue;
- memcached_quit_server(ptr, 1);
+ memcached_quit_server(ptr, true);
return -1;
}
default:
- memcached_quit_server(ptr, 1);
+ memcached_quit_server(ptr, true);
*error= MEMCACHED_ERRNO;
return -1;
}
if (ptr->type == MEMCACHED_CONNECTION_UDP &&
(size_t)sent_length != write_length)
{
- memcached_quit_server(ptr, 1);
+ memcached_quit_server(ptr, true);
return -1;
}
*/
void memcached_io_reset(memcached_server_instance_st *ptr)
{
- memcached_quit_server(ptr, 1);
+ memcached_quit_server(ptr, true);
}
/**