Merge lp:~msabramo/libmemcached/1190240 Build: jenkins-Libmemcached-363
[awesomized/libmemcached] / libtest / cmdline.cc
index 1423eca6ceb51f2ff47ba03234563d5db516f379..e813eb592c4da4730350ff103ff1994b6bb1f213 100644 (file)
@@ -59,6 +59,7 @@ using namespace libtest;
 #include <unistd.h>
 
 #include <algorithm>
+#include <stdexcept>
 
 #ifndef __USE_GNU
 static char **environ= NULL;
@@ -358,7 +359,7 @@ bool Application::slurp()
     int error;
     switch ((error= errno))
     {
-#ifdef TARGET_OS_LINUX
+#ifdef __linux
     case ERESTART:
 #endif
     case EINTR:
@@ -408,7 +409,7 @@ bool Application::slurp()
 
 Application::error_t Application::join()
 {
-  pid_t waited_pid= waitpid(_pid, &_status, 0);
+  pid_t waited_pid= waitpid(_pid, &_status, WUNTRACED);
   slurp();
   if (waited_pid == _pid and WIFEXITED(_status) == false)
   {
@@ -481,7 +482,7 @@ Application::error_t Application::join()
   }
   else if (waited_pid == -1)
   {
-    std::string error_string
+    std::string error_string;
     if (stdout_result_length())
     {
       error_string+= " stdout: ";