X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fcmdline.cc;h=6b8205cb1fff276fe8d02ccb172fd123e4329541;hb=7933fa8f9217d7e744876773a4033b3cda4c3c16;hp=6fc34031b95b319ce121b0a62fe54f8c14292a5f;hpb=96702d0bcb4bd8f45ede2830660e4ccb072675ab;p=m6w6%2Flibmemcached diff --git a/libtest/cmdline.cc b/libtest/cmdline.cc index 6fc34031..6b8205cb 100644 --- a/libtest/cmdline.cc +++ b/libtest/cmdline.cc @@ -36,6 +36,11 @@ using namespace libtest; #include #include #include +#include + +#ifndef __USE_GNU +static char **environ= NULL; +#endif extern "C" { static int exited_successfully(int status) @@ -108,6 +113,7 @@ Application::Application(const std::string& arg, const bool _use_libtool_arg) : _use_valgrind(false), _use_gdb(false), _use_ptrcheck(false), + _will_fail(false), _argc(0), _exectuble(arg), stdin_fd(STDIN_FILENO), @@ -247,7 +253,10 @@ Application::error_t Application::run(const char *args[]) if (spawn_ret != 0) { - Error << strerror(spawn_ret) << "(" << spawn_ret << ")"; + if (_will_fail == false) + { + Error << strerror(spawn_ret) << "(" << spawn_ret << ")"; + } _pid= -1; return Application::INVALID; } @@ -533,7 +542,7 @@ void Application::Pipe::reset() close(READ); close(WRITE); -#if _GNU_SOURCE +#if HAVE_PIPE2 if (pipe2(_pipe_fd, O_NONBLOCK) == -1) #else if (pipe(_pipe_fd) == -1) @@ -787,4 +796,9 @@ const char *gearmand_binary() return GEARMAND_BINARY; } +const char *drizzled_binary() +{ + return DRIZZLED_BINARY; +} + } // namespace exec_cmdline