Removing all of the multi-set bits (aka the buffer code is faster, so why
[m6w6/libmemcached] / src / memcat.c
index 1c9082f55a886a101f60f7517e19de37e0571786..4aaffb95ca71f9cfa8a19bd6db5887a90d740cae 100644 (file)
@@ -1,9 +1,10 @@
 #include <stdio.h>
+#include <inttypes.h>
+#include <string.h>
 #include <unistd.h>
 #include <getopt.h>
 #include <memcached.h>
 
-#include "client_options.h"
 #include "utilities.h"
 
 #define PROGRAM_NAME "memcat"
@@ -22,7 +23,7 @@ int main(int argc, char *argv[])
   memcached_st *memc;
   char *string;
   size_t string_length;
-  uint16_t flags;
+  uint32_t flags;
   memcached_return rc;
   memcached_server_st *servers;
 
@@ -68,8 +69,11 @@ int main(int argc, char *argv[])
     }
     else if (rc != MEMCACHED_NOTFOUND)
     {
-      fprintf(stderr, "memcat: %s: memcache error %s\n", 
+      fprintf(stderr, "memcat: %s: memcache error %s", 
               argv[optind], memcached_strerror(memc, rc));
+      if (memc->cached_errno)
+       fprintf(stderr, " system error %s", strerror(memc->cached_errno));
+      fprintf(stderr, "\n");
     }
     optind++;
   }