Fix warning.
[awesomized/libmemcached] / src / memflush.c
index 84db8b425d36c616800b384f019c8aca5495574b..075875a2d2778616b2361cd88dd66ebf896391bf 100644 (file)
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <unistd.h>
+#include <string.h>
 #include <getopt.h>
 #include <memcached.h>
 #include "client_options.h"
@@ -42,8 +43,11 @@ int main(int argc, char *argv[])
   rc = memcached_flush(memc, opt_expire);
   if (rc != MEMCACHED_SUCCESS) 
   {
-    fprintf(stderr, "memflush: memcache error %s\n", 
+    fprintf(stderr, "memflush: memcache error %s", 
            memcached_strerror(memc, rc));
+    if (memc->my_errno)
+      fprintf(stderr, " system error %s", strerror(memc->my_errno));
+    fprintf(stderr, "\n");
   }
 
   memcached_free(memc);