summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@ubuntu.com>2011-12-07 12:05:26 -0800
committerChase Douglas <chase.douglas@ubuntu.com>2011-12-07 12:05:26 -0800
commitf052b71de4ab05158b2b239d9d31d64e0aad76a4 (patch)
treee304bfe18dab9efbb2ff97162b52b10418df539e
parent723704879e551b971e1e3504be7338e371d4981d (diff)
Remove Process::Wait()
There are many ways to wait on the status of a process. We don't want to get into wrapping all of them. Let the caller pick and choose from the c library.
-rw-r--r--include/xorg/gtest/process.h2
-rw-r--r--src/environment.cpp2
-rw-r--r--src/process.cpp7
3 files changed, 1 insertions, 10 deletions
diff --git a/include/xorg/gtest/process.h b/include/xorg/gtest/process.h
index b345547..258e645 100644
--- a/include/xorg/gtest/process.h
+++ b/include/xorg/gtest/process.h
@@ -42,8 +42,6 @@ class Process {
void Start(const std::string& program, va_list args);
void Start(const std::string& program, ...);
- int Wait(int* status, int options);
-
bool Terminate();
bool Kill();
diff --git a/src/environment.cpp b/src/environment.cpp
index 14e3310..91a0161 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -68,7 +68,7 @@ void xorg::testing::Environment::SetUp() {
}
int status;
- int pid = d_->process.Wait(&status, WNOHANG);
+ int pid = waitpid(d_->process.Pid(), &status, WNOHANG);
if (pid == d_->process.Pid()) {
throw std::runtime_error("Dummy X server failed to start, did you run as "
"root?");
diff --git a/src/process.cpp b/src/process.cpp
index e964de3..8a8b694 100644
--- a/src/process.cpp
+++ b/src/process.cpp
@@ -80,13 +80,6 @@ void xorg::testing::Process::Start(const std::string& program, ...) {
va_end(list); /* Shouldn't get here */
}
-int xorg::testing::Process::Wait(int* status, int options) {
- if (d_->pid == -1 || d_->pid == 0)
- return false;
-
- return waitpid(d_->pid, status, options);
-}
-
bool xorg::testing::Process::Terminate() {
if (d_->pid == -1) {
return false;