summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/process.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/process.cpp b/src/process.cpp
index 4deea14..a9c041e 100644
--- a/src/process.cpp
+++ b/src/process.cpp
@@ -143,8 +143,6 @@ bool xorg::testing::Process::WaitForExit(unsigned int timeout) {
}
bool xorg::testing::Process::KillSelf(int signal, unsigned int timeout) {
- bool wait_success = true;
-
enum State state = GetState();
switch (state) {
case FINISHED_SUCCESS:
@@ -169,12 +167,17 @@ bool xorg::testing::Process::KillSelf(int signal, unsigned int timeout) {
d_->state = ERROR;
return false;
}
- if (timeout > 0)
+ if (timeout > 0) {
+ bool wait_success = true;
+
wait_success = WaitForExit(timeout);
+ if (!wait_success)
+ return false;
+ }
d_->pid = -1;
}
d_->state = TERMINATED;
- return wait_success;
+ return true;
}
bool xorg::testing::Process::Terminate(unsigned int timeout) {