Add ability to have version "just requested" when you initially connect.
[m6w6/libmemcached] / libtest / has.cc
index 17427d41b89fbfd6171193776bb2e9fa14ccf18e..ba4bbfc65efd6af1aa31db34f11c9b3141bfee99 100644 (file)
@@ -82,7 +82,7 @@ bool has_gearmand()
   {
     std::stringstream arg_buffer;
 
-    if (getenv("PWD"))
+    if (getenv("PWD") and strcmp(MEMCACHED_BINARY, "gearmand/gearmand") == 0)
     {
       arg_buffer << getenv("PWD");
       arg_buffer << "/";
@@ -111,13 +111,26 @@ bool has_drizzled()
   return false;
 }
 
+bool has_mysqld()
+{
+  if (HAVE_MYSQLD_BUILD)
+  {
+    if (access(MYSQLD_BINARY, X_OK) == 0)
+    {
+      return true;
+    }
+  }
+
+  return false;
+}
+
 bool has_memcached()
 {
   if (HAVE_MEMCACHED_BINARY)
   {
     std::stringstream arg_buffer;
 
-    if (getenv("PWD"))
+    if (getenv("PWD") and strcmp(MEMCACHED_BINARY, "memcached/memcached") == 0)
     {
       arg_buffer << getenv("PWD");
       arg_buffer << "/";
@@ -135,6 +148,7 @@ bool has_memcached()
 
 bool has_memcached_sasl()
 {
+#if defined(HAVE_MEMCACHED_SASL_BINARY) && HAVE_MEMCACHED_SASL_BINARY
   if (HAVE_MEMCACHED_SASL_BINARY)
   {
     if (access(MEMCACHED_SASL_BINARY, X_OK) == 0)
@@ -142,6 +156,7 @@ bool has_memcached_sasl()
       return true;
     }
   }
+#endif
 
   return false;
 }