aboutsummaryrefslogtreecommitdiffstats
path: root/lib/System/Unix
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2009-09-09 09:51:47 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2009-09-09 09:51:47 +0000
commitfd1f9fef9648975b0a201da42797d12415eeb83a (patch)
treec7c4c0623c578cb992fbb46e1ebe2f8d14ab0900 /lib/System/Unix
parentebd2da13f15d830ecbac3ffb953fc00bfde9bab2 (diff)
downloadexternal_llvm-fd1f9fef9648975b0a201da42797d12415eeb83a.zip
external_llvm-fd1f9fef9648975b0a201da42797d12415eeb83a.tar.gz
external_llvm-fd1f9fef9648975b0a201da42797d12415eeb83a.tar.bz2
Check that the 'kill' call succeeded.
Thanks to Duncan Sands for spotting this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81328 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Unix')
-rw-r--r--lib/System/Unix/Program.inc8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/System/Unix/Program.inc b/lib/System/Unix/Program.inc
index 1ffd71a..56dea25 100644
--- a/lib/System/Unix/Program.inc
+++ b/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(){