Extended tests so that memcached starts up its own tests
[awesomized/libmemcached] / src / memcp.c
index f51c93cb16281fa649dc406e28c0b5ffc805d35e..09d7e9119b0ec75b30085efe6f11c8eff248ecf8 100644 (file)
@@ -1,4 +1,6 @@
 #include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
 #include <unistd.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -7,6 +9,8 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <strings.h>
+#include <string.h>
+#include <assert.h>
 
 #include <memcached.h>
 #include "client_options.h"
@@ -112,8 +116,13 @@ 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);