From 7c41f51579dc36df33ec83a743dba8cc1ddc3e3f Mon Sep 17 00:00:00 2001 From: Date: Fri, 2 May 2008 15:11:07 -0700 Subject: [PATCH] Removed old asserts in client apps. --- clients/memcp.c | 8 ++++++-- clients/memslap.c | 1 - clients/memstat.c | 3 --- libmemcached/memcached_hosts.c | 3 --- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/clients/memcp.c b/clients/memcp.c index 780514c1..5b80fd64 100644 --- a/clients/memcp.c +++ b/clients/memcp.c @@ -10,7 +10,6 @@ #include #include #include -#include #include @@ -106,7 +105,12 @@ int main(int argc, char *argv[]) fprintf(stderr, "read: %s\n", strerror(errno)); exit(1); } - assert(read_length == sbuf.st_size); + + if (read_length != sbuf.st_size); + { + fprintf(stderr, "Failure reading from file\n"); + exit(1); + } if (opt_method == OPT_ADD) rc= memcached_add(memc, ptr, strlen(ptr), diff --git a/clients/memslap.c b/clients/memslap.c index 01f11e2d..6fc8176f 100644 --- a/clients/memslap.c +++ b/clients/memslap.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include diff --git a/clients/memstat.c b/clients/memstat.c index 3f1a78a3..36ee343e 100644 --- a/clients/memstat.c +++ b/clients/memstat.c @@ -5,7 +5,6 @@ #include #include #include -#include #include #include @@ -71,8 +70,6 @@ int main(int argc, char *argv[]) char **ptr; list= memcached_stat_get_keys(memc, &stat[x], &rc); - assert(list); - assert(rc == MEMCACHED_SUCCESS); printf("Server: %s (%u)\n", memcached_server_name(memc, server_list[x]), memcached_server_port(memc, server_list[x])); diff --git a/libmemcached/memcached_hosts.c b/libmemcached/memcached_hosts.c index 231b2167..2678a7c1 100644 --- a/libmemcached/memcached_hosts.c +++ b/libmemcached/memcached_hosts.c @@ -221,10 +221,7 @@ memcached_return memcached_server_push(memcached_st *ptr, memcached_server_st *l sizeof(memcached_server_st) * (count + ptr->number_of_hosts)); if (!new_host_list) - { - assert(0); return MEMCACHED_MEMORY_ALLOCATION_FAILURE; - } ptr->hosts= new_host_list; -- 2.30.2