#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
#include <unistd.h>
#include <getopt.h>
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#include <strings.h>
+#include <string.h>
+#include <assert.h>
#include <memcached.h>
#include "client_options.h"
static int opt_verbose= 0;
static char *opt_servers= NULL;
static int opt_method= OPT_SET;
-static uint16_t opt_flags= 0;
+static uint32_t opt_flags= 0;
static time_t opt_expires= 0;
int main(int argc, char *argv[])
opt_expires, opt_flags);
if (rc != MEMCACHED_SUCCESS)
- fprintf(stderr, "memcp: %s: memcache error %s\n",
+ {
+ fprintf(stderr, "memcp: %s: memcache error %s",
ptr, memcached_strerror(memc, rc));
+ if (memc->cached_errno)
+ fprintf(stderr, " system error %s", strerror(memc->cached_errno));
+ fprintf(stderr, "\n");
+ }
free(file_buffer_ptr);
close(fd);
opt_servers= strdup(optarg);
break;
case OPT_FLAG: /* --flag */
- opt_flags= (uint16_t)strtol(optarg, (char **)NULL, 16);
+ opt_flags= (uint32_t)strtol(optarg, (char **)NULL, 16);
break;
case OPT_EXPIRE: /* --expire */
opt_expires= (time_t)strtoll(optarg, (char **)NULL, 10);