+ if (WTERMSIG(_status) != SIGTERM and WTERMSIG(_status) != SIGHUP)
+ {
+ slurp();
+ _app_exit_state= Application::INVALID_POSIX_SPAWN;
+ std::string error_string(print_argv(built_argv));
+ error_string+= " was killed by signal ";
+ error_string+= strsignal(WTERMSIG(_status));
+
+ if (stdout_result_length())
+ {
+ error_string+= " stdout: ";
+ error_string+= stdout_c_str();
+ }
+
+ if (stderr_result_length())
+ {
+ error_string+= " stderr: ";
+ error_string+= stderr_c_str();
+ }
+
+ throw std::runtime_error(error_string);
+ }
+
+ // If we terminted it on purpose then it counts as a success.
+#if defined(DEBUG)
+ if (DEBUG)
+ {
+ Out << "waitpid() application terminated at request"
+ << " pid:" << _pid
+ << " name:" << built_argv[0];
+ }
+#endif