Add a Kill() function to the Program class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81246 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mikhail Glushenkov
2009-09-08 19:50:27 +00:00
parent 8e371aa7b6
commit a607202a68
3 changed files with 44 additions and 12 deletions

View File

@ -283,6 +283,16 @@ Program::Wait(unsigned secondsToWait,
}
bool
Program::Kill(std::string* ErrMsg) {
if (Pid_ == 0) {
MakeErrMsg(ErrMsg, "Process not started!");
return true;
}
return (kill(Pid_, SIGKILL) == 0);
}
bool Program::ChangeStdinToBinary(){
// Do nothing, as Unix doesn't differentiate between text and binary.
return false;