*
*/
-#include "libmemcached/common.h"
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
static char *opt_passwd;
/* Print the keys and counter how many were found */
-static memcached_return_t key_printer(const memcached_st *ptr __attribute__((unused)),
+static memcached_return_t key_printer(const memcached_st *ptr,
const char *key, size_t key_length,
- void *context __attribute__((unused)))
+ void *context)
{
+ (void)ptr;(void)context;
printf("%.*s\n", (uint32_t)key_length, key);
return MEMCACHED_SUCCESS;
if (!initialize_sasl(memc, opt_username, opt_passwd))
{
memcached_free(memc);
- return 1;
+ return EXIT_FAILURE;
}
rc= memcached_dump(memc, callbacks, NULL, 1);
if (rc != MEMCACHED_SUCCESS)
{
fprintf(stderr, "memdump: memcache error %s", memcached_strerror(memc, rc));
- if (memc->cached_errno)
- fprintf(stderr, " system error %s", strerror(memc->cached_errno));
+ if (memcached_last_error_errno(memc))
+ fprintf(stderr, " system error %s", strerror(memcached_last_error_errno(memc)));
fprintf(stderr, "\n");
}
shutdown_sasl();
- return 0;
+ return EXIT_SUCCESS;
}
static void options_parse(int argc, char *argv[])