* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
/*
Common include file for libmemached
*/
#include <config.h>
-#include <inttypes.h>
-#include <cstdlib>
-#include <sys/types.h>
-
-#include <cerrno>
#include <cassert>
+#include <cerrno>
+#include <cstdlib>
#include <sstream>
#include <string>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
+#ifdef HAVE_FNMATCH_H
+#include <fnmatch.h>
+#endif
+
#include <libtest/test.hpp>
#include <libtest/memcached.h>
#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)
_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();
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
{