From 8df91a76ebfb9d36e2e028e64b1e9f6db0c1d287 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Sat, 20 Aug 2011 00:49:41 +0100 Subject: [PATCH] Display a more helpful error message if waitpid() fails in ProcessUtils::waitForProcess() --- src/ProcessUtils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ProcessUtils.cpp b/src/ProcessUtils.cpp index 61aa110..c76322e 100644 --- a/src/ProcessUtils.cpp +++ b/src/ProcessUtils.cpp @@ -4,6 +4,8 @@ #include "StringUtils.h" #include "Log.h" +#include + #ifdef PLATFORM_WINDOWS #include #else @@ -40,7 +42,7 @@ bool ProcessUtils::waitForProcess(long long pid) pid_t result = ::waitpid(static_cast(pid), 0, 0); if (result < 0) { - LOG(Error,"waitpid() failed with error" + intToStr(errno)); + LOG(Error,"waitpid() failed with error: " + std::string(strerror(errno))); } return result > 0; #elif defined(PLATFORM_WINDOWS)