X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=lib%2Fmemcached_quit.c;h=89a55ecf43c96f0739152c1c851917d48bfd8c03;hb=257f0547823cf6b18473ba8bd2580b38235f6d79;hp=24a88c2d9c0d2d2ce56ef4ac6c0a59c2b3b65084;hpb=452f5b545eec58ac1bddd32ea131b79e2b1a52a9;p=awesomized%2Flibmemcached diff --git a/lib/memcached_quit.c b/lib/memcached_quit.c index 24a88c2d..89a55ecf 100644 --- a/lib/memcached_quit.c +++ b/lib/memcached_quit.c @@ -1,4 +1,4 @@ -#include +#include "common.h" /* This closes all connections (forces flush of input as well). @@ -13,9 +13,13 @@ void memcached_quit(memcached_st *ptr) { for (x= 0; x < ptr->number_of_hosts; x++) { - if (ptr->hosts[x].fd > 0) + if (ptr->hosts[x].fd != -1) + { close(ptr->hosts[x].fd); + ptr->hosts[x].fd= -1; + } } } + ptr->connected= 0; }