diff options
author | Thomas Voß <thomas.voss@rub.de> | 2011-12-13 10:08:09 +0100 |
---|---|---|
committer | Thomas Voß <thomas.voss@rub.de> | 2011-12-13 10:08:09 +0100 |
commit | 8ace60ed7cc70589de26ec3e5e409588a0f0bd00 (patch) | |
tree | fc2e874c3b34cd2a4e09cc926ad98922226a492f /src | |
parent | 932bf1ec03ed9160c9784fdbb7f3a9456a5beb50 (diff) |
Modified Process::Terminate and Process::Kill to reset process identifier. Adjusted documentation.
Diffstat (limited to 'src')
-rw-r--r-- | src/process.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/process.cpp b/src/process.cpp index 303237e..2f165b7 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -82,8 +82,10 @@ bool xorg::testing::Process::Terminate() { throw std::runtime_error("Child process tried to terminate itself"); } else { /* Parent */ if (kill(d_->pid, SIGTERM) < 0) { + d_->pid_ = -1; return false; } + d_->pid_ = -1; } return true; } @@ -96,8 +98,10 @@ bool xorg::testing::Process::Kill() { throw std::runtime_error("Child process tried to kill itself"); } else { /* Parent */ if (kill(d_->pid, SIGKILL) < 0) { + d_->pid_ = -1; return false; } + d_->pid_ = -1; } return true; } |