X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fmemcached.cc;h=fc7a37c693bafa2a1af53405d017a89b4c315a81;hb=1857b8b7b9c015f917a05e2e1f75c31253855c90;hp=ceb2d878cca9e36a50fb3c1f18f90e80bccd14e1;hpb=58c279d58e2a44562f729e93e301dfedf42f530b;p=awesomized%2Flibmemcached diff --git a/libtest/memcached.cc b/libtest/memcached.cc index ceb2d878..fc7a37c6 100644 --- a/libtest/memcached.cc +++ b/libtest/memcached.cc @@ -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; @@ -97,10 +95,15 @@ public: } pid_t local_pid; - memcached_return_t rc; + 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 ";