If the Process is forked after Start(), the child to be terminated isn't actually the child and we hang forever. Thus, treat ECHILD as success, after all if the child isn't there it can be seen as terminated.
Signed-off-by: Peter Hutterer <[email protected]> --- src/process.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/process.cpp b/src/process.cpp index 284ecbd..57ee35e 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -133,6 +133,8 @@ bool xorg::testing::Process::WaitForExit(unsigned int timeout) { if (pid == Pid()) return true; + else if (pid == -1) + return errno == ECHILD; usleep(10); } -- 1.7.11.2 _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
