Diligently check poll() a bit more. Also determine number of servers based on cores...
[m6w6/libmemcached] / libmemcached / io.cc
index 56239529eb2918a664c0d6971b51c92d1bc796f2..b08473a0c9bef42206d352c542f34a336c1549ad 100644 (file)
@@ -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)
     {