From: Brian Aker Date: Thu, 4 Aug 2011 01:53:16 +0000 (-0700) Subject: Update from libtest tree. X-Git-Tag: 0.52~31 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=9a004d258a19fc2ddc13d2d2c6b70d2b6e2ff54f;p=m6w6%2Flibmemcached Update from libtest tree. --- diff --git a/libtest/common.h b/libtest/common.h index c2fe5144..7a7f1ff0 100644 --- a/libtest/common.h +++ b/libtest/common.h @@ -19,7 +19,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ - /* Common include file for libmemached */ @@ -28,13 +27,30 @@ #include -#include -#include -#include - -#include #include +#include +#include #include #include +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +#ifdef HAVE_SYS_TIME_H +#include +#endif + +#ifdef HAVE_SYS_WAIT_H +#include +#endif + +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif + +#ifdef HAVE_FNMATCH_H +#include +#endif + #include diff --git a/libtest/server.cc b/libtest/server.cc index c2f38ba9..b8fb603e 100644 --- a/libtest/server.cc +++ b/libtest/server.cc @@ -51,6 +51,19 @@ static inline std::string &rtrim(std::string &s) #include #endif +extern "C" { + static bool exited_successfully(int status) + { + if (WEXITSTATUS(status) == 0) + { + return true; + } + + return true; + } +} + + namespace libtest { std::ostream& operator<<(std::ostream& output, const Server &arg) @@ -180,7 +193,8 @@ bool Server::start() _running+= " &"; } - if (system(_running.c_str()) == -1) + int ret= system(_running.c_str()); + if (not exited_successfully(ret)) { Error << "system() failed:" << strerror(errno); _running.clear(); @@ -513,6 +527,7 @@ bool server_startup_st::is_helgrind() const bool server_startup(server_startup_st& construct, const std::string& server_type, in_port_t try_port, int argc, const char *argv[]) { Outn(); + (void)try_port; // Look to see if we are being provided ports to use {