diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2009-09-08 20:31:27 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2009-09-08 20:31:27 +0000 |
commit | f1c3d5010f465057600c9085bdb15a702ef4a598 (patch) | |
tree | 3530af52d4ffd15e9384ef7d45299decadd4cc5c /lib/System | |
parent | a0ecbe782177d3ec7c98700434d2d92fb0c0e600 (diff) | |
download | external_llvm-f1c3d5010f465057600c9085bdb15a702ef4a598.zip external_llvm-f1c3d5010f465057600c9085bdb15a702ef4a598.tar.gz external_llvm-f1c3d5010f465057600c9085bdb15a702ef4a598.tar.bz2 |
This should unbreak the build on 64-bit Linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81252 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System')
-rw-r--r-- | lib/System/Unix/Program.inc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/System/Unix/Program.inc b/lib/System/Unix/Program.inc index f5290b4..1ffd71a 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<unsigned>(Data_); + uint64_t pid = reinterpret_cast<uint64_t>(Data_); + return static_cast<unsigned>(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<pid_t>(Data_); + uint64_t pid = reinterpret_cast<uint64_t>(Data_); + pid_t child = static_cast<pid_t>(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<pid_t>(Data_); + uint64_t pid64 = reinterpret_cast<uint64_t>(Data_); + pid_t pid = static_cast<pid_t>(pid64); return (kill(pid, SIGKILL) == 0); } |