X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=lib%2Fmemcached_quit.c;h=8481b990e8a45e19831e44981b1571e73dc6c333;hb=a368fe94e9bc94eb63adad413c668b046d6f583f;hp=24a88c2d9c0d2d2ce56ef4ac6c0a59c2b3b65084;hpb=452f5b545eec58ac1bddd32ea131b79e2b1a52a9;p=m6w6%2Flibmemcached diff --git a/lib/memcached_quit.c b/lib/memcached_quit.c index 24a88c2d..8481b990 100644 --- a/lib/memcached_quit.c +++ b/lib/memcached_quit.c @@ -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; }