From: Brian Aker Date: Wed, 13 Jun 2012 03:58:18 +0000 (-0700) Subject: Diligently check poll() a bit more. Also determine number of servers based on cores... X-Git-Tag: 1.0.9~22 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=262486489d4dec5f7af6046a27b9e6b337b45ea9;p=m6w6%2Flibmemcached Diligently check poll() a bit more. Also determine number of servers based on cores available. --- diff --git a/libmemcached/io.cc b/libmemcached/io.cc index 56239529..b08473a0 100644 --- a/libmemcached/io.cc +++ b/libmemcached/io.cc @@ -218,7 +218,13 @@ static memcached_return_t io_wait(memcached_server_write_instance_st ptr, break; } assert_msg(active_fd == 1 , "poll() returned an unexpected value"); - return MEMCACHED_SUCCESS; + + if (fds.revents & POLLIN or fds.revents & POLLOUT) + { + return MEMCACHED_SUCCESS; + } + + return memcached_set_error(*ptr, MEMCACHED_FAILURE, MEMCACHED_AT, memcached_literal_param("poll() returned a value that was not dealt with")); } else if (active_fd == 0) { diff --git a/tests/libmemcached-1.0/all_tests.cc b/tests/libmemcached-1.0/all_tests.cc index 4d4d4ca8..2efbdf27 100644 --- a/tests/libmemcached-1.0/all_tests.cc +++ b/tests/libmemcached-1.0/all_tests.cc @@ -79,7 +79,8 @@ void get_world(Framework *world) } else { - world->servers().set_servers_to_run(8); + world->servers().set_servers_to_run(libtest::number_of_cpus() > 3 ? + libtest::number_of_cpus() : 3); } world->collections(collection);