mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +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_);
|
uint64_t pid64 = reinterpret_cast<uint64_t>(Data_);
|
||||||
pid_t pid = static_cast<pid_t>(pid64);
|
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(){
|
bool Program::ChangeStdinToBinary(){
|
||||||
|
@ -347,7 +347,12 @@ Program::Kill(std::string* ErrMsg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HANDLE hProcess = reinterpret_cast<HANDLE>(Data_);
|
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(){
|
bool Program::ChangeStdinToBinary(){
|
||||||
|
Loading…
Reference in New Issue
Block a user