From 7c0f06c19e132fd4f202b1d1b2f5a16a2ee50217 Mon Sep 17 00:00:00 2001 From: Mikhail Glushenkov Date: Tue, 8 Sep 2009 20:31:27 +0000 Subject: [PATCH] This should unbreak the build on 64-bit Linux. llvm-svn: 81252 --- lib/System/Unix/Program.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/System/Unix/Program.inc b/lib/System/Unix/Program.inc index f5290b4075c..1ffd71af10d 100644 --- a/lib/System/Unix/Program.inc +++ b/lib/System/Unix/Program.inc @@ -39,7 +39,8 @@ Program::Program() : Data_(0) {} Program::~Program() {} unsigned Program::GetPid() const { - return reinterpret_cast(Data_); + uint64_t pid = reinterpret_cast(Data_); + return static_cast(pid); } // This function just uses the PATH environment variable to find the program. @@ -241,7 +242,8 @@ Program::Wait(unsigned secondsToWait, // Parent process: Wait for the child process to terminate. int status; - pid_t child = reinterpret_cast(Data_); + uint64_t pid = reinterpret_cast(Data_); + pid_t child = static_cast(pid); while (wait(&status) != child) if (secondsToWait && errno == EINTR) { // Kill the child. @@ -294,7 +296,8 @@ Program::Kill(std::string* ErrMsg) { return true; } - pid_t pid = reinterpret_cast(Data_); + uint64_t pid64 = reinterpret_cast(Data_); + pid_t pid = static_cast(pid64); return (kill(pid, SIGKILL) == 0); }