Display a more helpful error message if waitpid() fails in ProcessUtils::waitForProcess()

This commit is contained in:
Robert Knight 2011-08-20 00:49:41 +01:00
parent ceb3b7d6a0
commit 8df91a76eb

View file

@ -4,6 +4,8 @@
#include "StringUtils.h" #include "StringUtils.h"
#include "Log.h" #include "Log.h"
#include <string.h>
#ifdef PLATFORM_WINDOWS #ifdef PLATFORM_WINDOWS
#include <windows.h> #include <windows.h>
#else #else
@ -40,7 +42,7 @@ bool ProcessUtils::waitForProcess(long long pid)
pid_t result = ::waitpid(static_cast<pid_t>(pid), 0, 0); pid_t result = ::waitpid(static_cast<pid_t>(pid), 0, 0);
if (result < 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; return result > 0;
#elif defined(PLATFORM_WINDOWS) #elif defined(PLATFORM_WINDOWS)