See if this fixes the ICC
[m6w6/libmemcached] / libtest / memcached.cc
index 3e8e3fcdea9b7600c551c5bdfca46a38ef60698f..7d25153fb078c783734bdaa314ce4862f1f51b70 100644 (file)
@@ -22,8 +22,8 @@
 
 #include <libtest/common.h>
 
-#include <libmemcached/memcached.h>
-#include <libmemcached/util.h>
+#include <libmemcached-1.0/memcached.h>
+#include <libmemcachedutil-1.0/util.h>
 
 using namespace libtest;
 
@@ -87,9 +87,7 @@ public:
     // Memcached is slow to start, so we need to do this
     if (not pid_file().empty())
     {
-      Wait wait(pid_file(), 0);
-
-      if (error_is_ok and not wait.successful())
+      if (error_is_ok and not wait_for_pidfile())
       {
         Error << "Pidfile was not found:" << pid_file();
         return -1;
@@ -100,7 +98,12 @@ public:
     memcached_return_t rc= MEMCACHED_SUCCESS;
     if (has_socket())
     {
-      local_pid= libmemcached_util_getpid(socket().c_str(), 0, &rc);
+      if (socket().empty())
+      {
+        return -1;
+      }
+
+      local_pid= libmemcached_util_getpid(socket().c_str(), port(), &rc);
     }
     else
     {
@@ -120,9 +123,7 @@ public:
     // Memcached is slow to start, so we need to do this
     if (not pid_file().empty())
     {
-      Wait wait(pid_file(), 0);
-
-      if (not wait.successful())
+      if (not wait_for_pidfile())
       {
         Error << "Pidfile was not found:" << pid_file();
         return -1;
@@ -230,9 +231,7 @@ public:
     // Memcached is slow to start, so we need to do this
     if (not pid_file().empty())
     {
-      Wait wait(pid_file(), 0);
-
-      if (error_is_ok and not wait.successful())
+      if (error_is_ok and not wait_for_pidfile())
       {
         Error << "Pidfile was not found:" << pid_file();
         return -1;
@@ -263,9 +262,7 @@ public:
     // Memcached is slow to start, so we need to do this
     if (not pid_file().empty())
     {
-      Wait wait(pid_file(), 0);
-
-      if (not wait.successful())
+      if (not wait_for_pidfile())
       {
         Error << "Pidfile was not found:" << pid_file();
         return -1;
@@ -306,7 +303,7 @@ bool Memcached::build(int argc, const char *argv[])
     arg_buffer << " -u root ";
   }
 
-  arg_buffer << " -l 127.0.0.1 ";
+  arg_buffer << " -l localhost ";
   arg_buffer << " -m 128 ";
   arg_buffer << " -M ";