Check for local memcached, and then add PWD
authorBrian Aker <brian@tangent.org>
Fri, 25 May 2012 01:27:55 +0000 (21:27 -0400)
committerBrian Aker <brian@tangent.org>
Fri, 25 May 2012 01:27:55 +0000 (21:27 -0400)
libtest/has.cc

index 699a1326a4364b96b46b78ed492d26277beed345..17427d41b89fbfd6171193776bb2e9fa14ccf18e 100644 (file)
@@ -42,7 +42,7 @@
 
 namespace libtest {
 
-bool has_memcached_support(void)
+bool has_libmemcached(void)
 {
   if (HAVE_LIBMEMCACHED)
   {
@@ -115,7 +115,16 @@ bool has_memcached()
 {
   if (HAVE_MEMCACHED_BINARY)
   {
-    if (access(MEMCACHED_BINARY, X_OK) == 0)
+    std::stringstream arg_buffer;
+
+    if (getenv("PWD"))
+    {
+      arg_buffer << getenv("PWD");
+      arg_buffer << "/";
+    }
+    arg_buffer << MEMCACHED_BINARY;
+
+    if (access(arg_buffer.str().c_str(), X_OK) == 0)
     {
       return true;
     }