summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Martin <consume.noise@gmail.com>2012-10-02 01:22:47 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2012-10-04 15:53:02 +1000
commit9fc0a77c640a45709164303fba0af60e9da2c574 (patch)
treec2c7b9ecaba9109ec4d7b480ebebcbcc6038feb5 /src
parent4dd5353497395fb1fd38d235e9b27b028d564923 (diff)
Deprecate WaitForConnections()
As we already know that the XServer is ready for connections due to it's notification via SIGUSR1, we don't need to poll anymore. This only deprecates the call and warns potential users, it will be removed in a future release. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r--src/environment.cpp1
-rw-r--r--src/xserver.cpp30
2 files changed, 0 insertions, 31 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index 54eb6b6..44d6b2e 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -106,7 +106,6 @@ void xorg::testing::Environment::SetUp() {
if (d_->path_to_conf.length())
d_->server.SetOption("-config", d_->path_to_log_file);
d_->server.Start(d_->path_to_server);
- d_->server.WaitForConnections();
Process::SetEnv("DISPLAY", d_->server.GetDisplayString(), true);
}
diff --git a/src/xserver.cpp b/src/xserver.cpp
index 2ff718d..082818c 100644
--- a/src/xserver.cpp
+++ b/src/xserver.cpp
@@ -222,36 +222,6 @@ bool xorg::testing::XServer::WaitForDevice(::Display *display, const std::string
}
void xorg::testing::XServer::WaitForConnections(void) {
- for (int i = 0; i < 100; ++i) {
- Display *test_display = XOpenDisplay(GetDisplayString().c_str());
-
- if (test_display) {
- XCloseDisplay(test_display);
- return;
- }
-
- int status;
- int pid = waitpid(Pid(), &status, WNOHANG);
- if (pid == Pid()) {
- std::string message;
- message += "X server failed to start on display ";
- message += GetDisplayString();
- message += ". Ensure that the correct video driver is installed.\n"
- "If the X.org server is older than 1.12, "
- "tests will need to be run as root.\nCheck ";
- message += d_->options["-logfile"];
- message += " for any errors";
- throw std::runtime_error(message);
- } else if (pid == 0) {
- usleep(100);
- } else if (pid == -1) {
- throw std::runtime_error("Could not get status of X server process");
- } else {
- throw std::runtime_error("Invalid child PID returned by Process::Wait()");
- }
- }
-
- throw std::runtime_error("Unable to open connection to X server");
}
void xorg::testing::XServer::TestStartup(void) {