Merge in a number of fixes for OpenBSD.
[m6w6/libmemcached] / clients / utilities.c
index de2bdf442eba9a866c84485b36b060d12598216a..52f46b40562fc55b1bcc5b4b79ea1944de643cd8 100644 (file)
@@ -61,6 +61,7 @@ static const char *lookup_help(memcached_options option)
   case OPT_USERNAME: return "Username to use for SASL authentication";
   case OPT_PASSWD: return "Password to use for SASL authentication";
   case OPT_FILE: return "Path to file in which to save result";
+  case OPT_STAT_ARGS: return "Argument for statistics";
   default: WATCHPOINT_ASSERT(0);
   };
 
@@ -215,3 +216,16 @@ void shutdown_sasl(void)
     sasl_done();
 #endif
 }
+
+void initialize_sockets(void)
+{
+  /* Define the function for all platforms to avoid #ifdefs in each program */
+#ifdef WIN32
+  WSADATA wsaData;
+  if (WSAStartup(MAKEWORD(2,0), &wsaData) != 0)
+  {
+    fprintf(stderr, "Socket Initialization Error. Program aborted\n");
+    exit(EXIT_FAILURE);
+  }
+#endif
+}