From: Brian Aker Date: Fri, 25 May 2012 01:27:55 +0000 (-0400) Subject: Check for local memcached, and then add PWD X-Git-Tag: 1.0.9~34^2~4 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=a7df49566dd006c5725eabcd11aab958cf8e5600;p=m6w6%2Flibmemcached Check for local memcached, and then add PWD --- 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; }