mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-14 07:31:53 +00:00
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
This commit is contained in:
parent
6e89b6f107
commit
8add26934a
@ -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(){
|
||||
|
@ -347,7 +347,12 @@ Program::Kill(std::string* ErrMsg) {
|
||||
}
|
||||
|
||||
HANDLE hProcess = reinterpret_cast<HANDLE>(Data_);
|
||||
return TerminateProcess(hProcess, 1);
|
||||
if (TerminateProcess(hProcess, 1) == 0) {
|
||||
MakeErrMsg(ErrMsg, "The process couldn't be killed!");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Program::ChangeStdinToBinary(){
|
||||
|
Loading…
Reference in New Issue
Block a user