If this variable is set, leave stdout and stderr open for the child process to see potential error messages thrown by that child.
Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> --- README | 3 +++ src/process.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README b/README index 33e1fe3..bda4b66 100644 --- a/README +++ b/README @@ -79,3 +79,6 @@ Environment variables --------------------- XORG_GTEST_XSERVER_SIGSTOP If set, an XServer object will raise a SIGSTOP signal after startup. +XORG_GTEST_CHILD_STDOUT + If set to any value, Process::Start() will _not_ close stdout/stdin/stderr + for the forked child. diff --git a/src/process.cpp b/src/process.cpp index 7df2b84..03dbc42 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -58,8 +58,10 @@ void xorg::testing::Process::Start(const std::string &program, const std::vector throw std::runtime_error("Failed to fork child process"); } else if (d_->pid == 0) { /* Child */ close(0); - close(1); - close(2); + if (getenv("XORG_GTEST_CHILD_STDOUT") == NULL) { + close(1); + close(2); + } std::vector<char*> args; std::vector<std::string>::const_iterator it; -- 1.7.11.2 _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel