From: Date: Sat, 15 Nov 2008 16:06:42 +0000 (-0500) Subject: Remove dead variable and on close check value of file descriptor. X-Git-Tag: 0.25~8 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=7a85b394e18dc4d8b1450174372d45eff846b908;p=m6w6%2Flibmemcached Remove dead variable and on close check value of file descriptor. --- diff --git a/libmemcached/jenkins_hash.c b/libmemcached/jenkins_hash.c index 55b52709..940e4718 100644 --- a/libmemcached/jenkins_hash.c +++ b/libmemcached/jenkins_hash.c @@ -65,7 +65,6 @@ uint32_t jenkins_hash(const void *key, size_t length, uint32_t initval) u.ptr = key; if ((u.i & 0x3) == 0) { const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */ - const uint8_t *k8; /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ while (length > 12) diff --git a/libmemcached/memcached_connect.c b/libmemcached/memcached_connect.c index 2b392fb6..57bce101 100644 --- a/libmemcached/memcached_connect.c +++ b/libmemcached/memcached_connect.c @@ -184,8 +184,6 @@ static memcached_return network_connect(memcached_server_st *ptr) return MEMCACHED_FAILURE; } } - /* Old connection junk still is in the structure */ - WATCHPOINT_ASSERT(ptr->cursor_active == 0); if (ptr->sockaddr_inited == MEMCACHED_NOT_ALLOCATED || (!(ptr->root->flags & MEM_USE_CACHE_LOOKUPS))) diff --git a/libmemcached/memcached_io.c b/libmemcached/memcached_io.c index da845912..735a8d53 100644 --- a/libmemcached/memcached_io.c +++ b/libmemcached/memcached_io.c @@ -219,13 +219,17 @@ ssize_t memcached_io_write(memcached_server_st *ptr, memcached_return memcached_io_close(memcached_server_st *ptr) { int r; - /* in case of death shutdown to avoid blocking at close() */ + if (ptr->fd == -1) + return MEMCACHED_SUCCESS; + + /* in case of death shutdown to avoid blocking at close() */ r= shutdown(ptr->fd, SHUT_RDWR); #ifdef HAVE_DEBUG if (r && errno != ENOTCONN) { + WATCHPOINT_NUMBER(ptr->fd); WATCHPOINT_ERRNO(errno); WATCHPOINT_ASSERT(errno); } diff --git a/libmemcached/memcached_purge.c b/libmemcached/memcached_purge.c index 749a30d6..0fbd453c 100644 --- a/libmemcached/memcached_purge.c +++ b/libmemcached/memcached_purge.c @@ -7,7 +7,6 @@ void memcached_purge(memcached_server_st *ptr) { int32_t timeout; char buffer[2048]; - size_t buffer_length= sizeof(buffer); memcached_result_st result; if (ptr->root->purging || /* already purging */