Fixed bug reported by Stuart Midgley about what happens when there are no
[awesomized/libmemcached] / lib / memcached_flush.c
index 41b193fc3f9ac6a3ff4c8196aa00bd86fd03bc51..58f5bff2d8919be99c7d7a09e738f984f109bf02 100644 (file)
@@ -8,7 +8,10 @@ memcached_return memcached_flush(memcached_st *ptr, time_t expiration)
   char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
   LIBMEMCACHED_MEMCACHED_FLUSH_START();
 
-  rc= memcached_connect(ptr);
+  rc= memcached_connect(ptr, 0);
+
+  if (rc == MEMCACHED_NO_SERVERS)
+    return rc;
 
   if (rc != MEMCACHED_SUCCESS)
     rc= MEMCACHED_SOME_ERRORS;