diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2009-09-09 09:51:47 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2009-09-09 09:51:47 +0000 |
commit | d2f8a111cd06ad99092e3f8b453fe69495f6563e (patch) | |
tree | a43f5843aead057bc3713f463cd3007519b5c813 /llvm/lib/System/Unix | |
parent | a40184aa7749dc10ab8af4fade6e8947239bb4c9 (diff) | |
download | bcm5719-llvm-d2f8a111cd06ad99092e3f8b453fe69495f6563e.tar.gz bcm5719-llvm-d2f8a111cd06ad99092e3f8b453fe69495f6563e.zip |
Check that the 'kill' call succeeded.
Thanks to Duncan Sands for spotting this.
llvm-svn: 81328
Diffstat (limited to 'llvm/lib/System/Unix')
-rw-r--r-- | llvm/lib/System/Unix/Program.inc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/System/Unix/Program.inc b/llvm/lib/System/Unix/Program.inc index 1ffd71af10d..56dea250a77 100644 --- a/llvm/lib/System/Unix/Program.inc +++ b/llvm/lib/System/Unix/Program.inc @@ -298,7 +298,13 @@ Program::Kill(std::string* ErrMsg) { uint64_t pid64 = reinterpret_cast<uint64_t>(Data_); pid_t pid = static_cast<pid_t>(pid64); - return (kill(pid, SIGKILL) == 0); + + if (kill(pid, SIGKILL) != 0) { + MakeErrMsg(ErrMsg, "The process couldn't be killed!"); + return true; + } + + return false; } bool Program::ChangeStdinToBinary(){ |