From: Brian Aker Date: Wed, 28 Jul 2010 20:59:36 +0000 (-0700) Subject: Merge Trond, this is the preliminary support for Windows. X-Git-Tag: 0.44~12 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=14563e0f4a2840f6a038fc9fd44ae8bd48206be6;hp=14c82a8170d735093bb249ce58dae91c4d47e968;p=awesomized%2Flibmemcached Merge Trond, this is the preliminary support for Windows. --- diff --git a/clients/client_options.h b/clients/client_options.h index b0111707..70329051 100644 --- a/clients/client_options.h +++ b/clients/client_options.h @@ -38,6 +38,7 @@ typedef enum { OPT_UDP, OPT_USERNAME, OPT_PASSWD, + OPT_STAT_ARGS, OPT_FILE= 'f' } memcached_options; diff --git a/clients/memstat.c b/clients/memstat.c index 0bc365ac..765e7ab7 100644 --- a/clients/memstat.c +++ b/clients/memstat.c @@ -40,10 +40,12 @@ static int opt_verbose= 0; static int opt_displayflag= 0; static int opt_analyze= 0; static char *opt_servers= NULL; +static char *stat_args= NULL; static char *analyze_mode= NULL; static struct option long_options[]= { + {(OPTIONSTRING)"args", required_argument, NULL, OPT_STAT_ARGS}, {(OPTIONSTRING)"version", no_argument, NULL, OPT_VERSION}, {(OPTIONSTRING)"help", no_argument, NULL, OPT_HELP}, {(OPTIONSTRING)"verbose", no_argument, &opt_verbose, OPT_VERBOSE}, @@ -126,7 +128,7 @@ int main(int argc, char *argv[]) } else { - rc= memcached_stat_execute(memc, NULL, stat_printer, NULL); + rc= memcached_stat_execute(memc, stat_args, stat_printer, NULL); } free(opt_servers); @@ -332,6 +334,9 @@ static void options_parse(int argc, char *argv[]) case OPT_SERVERS: /* --servers or -s */ opt_servers= strdup(optarg); break; + case OPT_STAT_ARGS: + stat_args= strdup(optarg); + break; case OPT_ANALYZE: /* --analyze or -a */ opt_analyze= OPT_ANALYZE; analyze_mode= (optarg) ? strdup(optarg) : NULL; diff --git a/clients/ms_conn.c b/clients/ms_conn.c index 005879bd..82016e1f 100644 --- a/clients/ms_conn.c +++ b/clients/ms_conn.c @@ -800,7 +800,7 @@ static int ms_network_connect(ms_conn_t *c, #ifdef AI_ADDRCONFIG hints.ai_flags= AI_PASSIVE | AI_ADDRCONFIG; #else -+ hints.ai_flags= AI_PASSIVE; + hints.ai_flags= AI_PASSIVE; #endif /* AI_ADDRCONFIG */ if (is_udp) { diff --git a/clients/utilities.c b/clients/utilities.c index 4d36cd20..52f46b40 100644 --- a/clients/utilities.c +++ b/clients/utilities.c @@ -61,6 +61,7 @@ static const char *lookup_help(memcached_options option) case OPT_USERNAME: return "Username to use for SASL authentication"; case OPT_PASSWD: return "Password to use for SASL authentication"; case OPT_FILE: return "Path to file in which to save result"; + case OPT_STAT_ARGS: return "Argument for statistics"; default: WATCHPOINT_ASSERT(0); }; diff --git a/tests/include.am b/tests/include.am index 7a9c2062..501939df 100644 --- a/tests/include.am +++ b/tests/include.am @@ -92,20 +92,20 @@ tests_memplus_LDADD = $(tests_memplus_DEPENDENCIES) $(LIBSASL) test: check check-local: $(TEST_DOCS) test-mem test-hash memcapable - echo "Tests completed" + @echo "Tests completed" test-x: check-local test-plus test-memcat test-memcp test-memrm test-memerror test-memdump test-memflush test-memstat - echo "Tests completed" + @echo "Tests completed" memcapable: clients/memcapable - @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555 + @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555 @clients/memcapable -p 12555 || echo "Your memcached server does not support all commands" @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server" @rm tests/Xumemc.pid test-memcat: clients/memcat clients/memcp @echo "Testing memcat" - @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555 + @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555 @clients/memcp --servers="localhost:12555" `pwd`/clients/memcp @clients/memcat --servers="localhost:12555" memcp > `pwd`/tests/scratch @clients/memcat --servers="localhost:12555" --file=`pwd`/tests/scratch2 memcp @@ -117,7 +117,7 @@ test-memcat: clients/memcat clients/memcp valgrind-memcat: clients/memcat clients/memcp @echo "Testing memcat" - @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555 + @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555 @clients/memcp --servers="localhost:12555" clients/memcp @$(VALGRIND_COMMAND) clients/memcat --servers="localhost:12555" memcp > tests/scratch # @diff clients/memcp tests/scratch @@ -127,21 +127,21 @@ valgrind-memcat: clients/memcat clients/memcp test-memcp: clients/memcp @echo "Testing memcp" - @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555 + @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555 @clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server" @rm tests/Xumemc.pid valgrind-memcp: clients/memcat clients/memcp @echo "Testing memcp" - @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555 + @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555 @$(VALGRIND_COMMAND) clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server" @rm tests/Xumemc.pid test-memrm: clients/memrm clients/memcp @echo "Testing memrm" - @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555 + @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555 @clients/memcp --servers="localhost:12555" clients/memcat @clients/memrm --servers="localhost:12555" memcat @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server" @@ -149,7 +149,7 @@ test-memrm: clients/memrm clients/memcp valgrind-memrm: clients/memcat clients/memcp @echo "Testing memrm" - @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555 + @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555 @clients/memcp --servers="localhost:12555" clients/memcat @$(VALGRIND_COMMAND) clients/memrm --servers="localhost:12555" memcat @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server" @@ -157,21 +157,21 @@ valgrind-memrm: clients/memcat clients/memcp test-memflush: clients/memflush @echo "Testing memflush" - @$(MEMC_BINARY) -d -P `pwd`/tests/Xumemc.pid -p 12555 + @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555 @clients/memflush --servers="localhost:12555" @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server" @rm tests/Xumemc.pid valgrind-memflush: clients/memflush @echo "Testing memflush" - @$(MEMC_BINARY) -d -P `pwd`/tests/Xumemc.pid -p 12555 + @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555 @$(VALGRIND_COMMAND) clients/memflush --servers="localhost:12555" @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server" @rm tests/Xumemc.pid test-memdump: clients/memdump clients/memcp @echo "Testing memdump" - @$(MEMC_BINARY) -d -P `pwd`/tests/Xumemc.pid -p 12555 + @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555 @clients/memcp --servers="localhost:12555" clients/memcat @clients/memdump --servers="localhost:12555" > /dev/null @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server" @@ -179,7 +179,7 @@ test-memdump: clients/memdump clients/memcp valgrind-memdump: clients/memcat clients/memcp @echo "Testing memdump" - @$(MEMC_BINARY) -d -P `pwd`/tests/Xumemc.pid -p 12555 + @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555 @clients/memcp --servers="localhost:12555" clients/memcat @$(VALGRIND_COMMAND) clients/memdump --servers="localhost:12555" > /dev/null @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server" @@ -187,14 +187,14 @@ valgrind-memdump: clients/memcat clients/memcp test-memstat: clients/memstat @echo "Testing memstat" - @$(MEMC_BINARY) -d -P `pwd`/tests/Xumemc.pid -p 12555 + @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555 @clients/memstat --servers="localhost:12555" > /dev/null @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server" @rm tests/Xumemc.pid valgrind-memstat: clients/memstat @echo "Testing memstat" - @$(MEMC_BINARY) -d -P `pwd`/tests/Xumemc.pid -p 12555 + @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555 @$(VALGRIND_COMMAND) clients/memstat --servers="localhost:12555" > /dev/null @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server" @rm tests/Xumemc.pid diff --git a/tests/mem_functions.c b/tests/mem_functions.c index ad81f9d9..06c414a8 100644 --- a/tests/mem_functions.c +++ b/tests/mem_functions.c @@ -2781,7 +2781,7 @@ static test_return_t user_supplied_bug16(memcached_st *memc) return TEST_SUCCESS; } -#ifndef __sun +#if !defined(__sun) && !defined(__OpenBSD__) /* Check the validity of chinese key*/ static test_return_t user_supplied_bug17(memcached_st *memc) { @@ -6222,7 +6222,7 @@ test_st user_tests[] ={ {"user_supplied_bug14", 1, (test_callback_fn)user_supplied_bug14 }, {"user_supplied_bug15", 1, (test_callback_fn)user_supplied_bug15 }, {"user_supplied_bug16", 1, (test_callback_fn)user_supplied_bug16 }, -#ifndef __sun +#if !defined(__sun) && !defined(__OpenBSD__) /* ** It seems to be something weird with the character sets.. ** value_fetch is unable to parse the value line (iscntrl "fails"), so I diff --git a/tests/server.c b/tests/server.c index f2717795..f8d06dbf 100644 --- a/tests/server.c +++ b/tests/server.c @@ -73,12 +73,12 @@ void server_startup(server_startup_st *construct) if (x == 0) { - sprintf(buffer, "%s -d -P /tmp/%umemc.pid -t 1 -p %u -U %u -m 128", + sprintf(buffer, "%s -d -u root -P /tmp/%umemc.pid -t 1 -p %u -U %u -m 128", MEMCACHED_BINARY, x, x + TEST_PORT_BASE, x + TEST_PORT_BASE); } else { - sprintf(buffer, "%s -d -P /tmp/%umemc.pid -t 1 -p %u -U %u", + sprintf(buffer, "%s -d -u root -P /tmp/%umemc.pid -t 1 -p %u -U %u", MEMCACHED_BINARY, x, x + TEST_PORT_BASE, x + TEST_PORT_BASE); } if (libmemcached_util_ping("localhost", (in_port_t)(x + TEST_PORT_BASE), NULL))