From 12af94707fe4ab7e55f0e52ed262f6b45aeec5ed Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 10 Aug 2015 01:53:16 +0200 Subject: [PATCH] Fix cloggage of the pipe communicating with the forked X11 splash window subprocess --- direct/src/plugin/p3dX11SplashWindow.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/direct/src/plugin/p3dX11SplashWindow.cxx b/direct/src/plugin/p3dX11SplashWindow.cxx index f1afc5a15b..513458521e 100644 --- a/direct/src/plugin/p3dX11SplashWindow.cxx +++ b/direct/src/plugin/p3dX11SplashWindow.cxx @@ -681,10 +681,13 @@ subprocess_run() { } } - if (input_ready) { + do { + // Empty the pipe of whatever is in it. receive_command(); - } + input_ready = _pipe_read.has_gdata(); + } while (input_ready); + // Sleep a good amount in order not to lock up the system. struct timespec req; req.tv_sec = 0; req.tv_nsec = 50000000; // 50 ms