X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fio.cc;h=ab9c9b9265b3c5fdba2ca05f36ed38fb3d75bfec;hb=e01fd594da5192aca15a99b1e7df25eacb28514f;hp=50fa77ae404dd256d0e9e2daa2c76d4e1fad60d2;hpb=1bcc4d8c163e2b696d6ce313a6cba423e81173f9;p=m6w6%2Flibmemcached diff --git a/libmemcached/io.cc b/libmemcached/io.cc index 50fa77ae..ab9c9b92 100644 --- a/libmemcached/io.cc +++ b/libmemcached/io.cc @@ -193,7 +193,7 @@ static memcached_return_t io_wait(memcached_server_write_instance_st ptr, if (read_or_write == MEM_WRITE) { memcached_return_t rc= memcached_purge(ptr); - if (rc != MEMCACHED_SUCCESS && rc != MEMCACHED_STORED) + if (memcached_fatal(rc)) { return MEMCACHED_FAILURE; } @@ -278,11 +278,10 @@ static bool io_flush(memcached_server_write_instance_st ptr, ** in the purge function to avoid duplicating the logic.. */ { - memcached_return_t rc; WATCHPOINT_ASSERT(ptr->fd != INVALID_SOCKET); - rc= memcached_purge(ptr); + memcached_return_t rc= memcached_purge(ptr); - if (rc != MEMCACHED_SUCCESS && rc != MEMCACHED_STORED) + if (rc != MEMCACHED_SUCCESS and rc != MEMCACHED_STORED) { return false; } @@ -675,7 +674,7 @@ memcached_server_write_instance_st memcached_io_get_readable_server(memcached_st { #define MAX_SERVERS_TO_POLL 100 struct pollfd fds[MAX_SERVERS_TO_POLL]; - unsigned int host_index= 0; + nfds_t host_index= 0; for (uint32_t x= 0; x < memcached_server_count(memc) and host_index < MAX_SERVERS_TO_POLL; ++x) { @@ -722,7 +721,7 @@ memcached_server_write_instance_st memcached_io_get_readable_server(memcached_st break; default: - for (size_t x= 0; x < host_index; ++x) + for (nfds_t x= 0; x < host_index; ++x) { if (fds[x].revents & POLLIN) {