From a7df49566dd006c5725eabcd11aab958cf8e5600 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Thu, 24 May 2012 21:27:55 -0400 Subject: [PATCH] Check for local memcached, and then add PWD --- libtest/has.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libtest/has.cc b/libtest/has.cc index 699a1326..17427d41 100644 --- a/libtest/has.cc +++ b/libtest/has.cc @@ -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; } -- 2.30.2