X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fbinaries.cc;h=2efde2f3791c4c1060a8cf83887cb237166a6932;hb=5deca7af238185cfb53be80909b45ed807282b26;hp=00a897660f5dbc2ae421d4f776467441e9a9b20d;hpb=9835056a5f5240281d13505f1f6fb70085b257b9;p=m6w6%2Flibmemcached diff --git a/libtest/binaries.cc b/libtest/binaries.cc index 00a89766..2efde2f3 100644 --- a/libtest/binaries.cc +++ b/libtest/binaries.cc @@ -20,6 +20,7 @@ */ +#include #include namespace libtest { @@ -27,7 +28,28 @@ namespace libtest { bool has_gearmand_binary() { #if defined(HAVE_GEARMAND_BINARY) && HAVE_GEARMAND_BINARY - if (access(GEARMAND_BINARY,R_OK|X_OK) == 0) + std::stringstream arg_buffer; + + if (getenv("PWD")) + { + arg_buffer << getenv("PWD"); + arg_buffer << "/"; + } + arg_buffer << GEARMAND_BINARY; + + if (access(arg_buffer.str().c_str() ,R_OK|X_OK) == 0) + { + return true; + } +#endif + + return false; +} + +bool has_drizzled_binary() +{ +#if defined(HAVE_DRIZZLED_BINARY) && HAVE_DRIZZLED_BINARY + if (access(DRIZZLED_BINARY, R_OK|X_OK) == 0) { return true; } @@ -39,7 +61,7 @@ bool has_gearmand_binary() bool has_memcached_binary() { #if defined(HAVE_MEMCACHED_BINARY) && HAVE_MEMCACHED_BINARY - if (access(MEMCACHED_BINARY,R_OK|X_OK) == 0) + if (access(MEMCACHED_BINARY, R_OK|X_OK) == 0) { return true; }