diff options
Diffstat (limited to 'vcl/unx/glxtest.cxx')
-rw-r--r-- | vcl/unx/glxtest.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vcl/unx/glxtest.cxx b/vcl/unx/glxtest.cxx index b0cdde234c2b..70d34fb7318d 100644 --- a/vcl/unx/glxtest.cxx +++ b/vcl/unx/glxtest.cxx @@ -27,6 +27,8 @@ #include <string.h> #include <signal.h> +#include <sys/wait.h> + #include <opengl/x11/glxtest.hxx> #ifdef __SUNPRO_CC @@ -36,6 +38,8 @@ #include <X11/Xlib.h> #include <X11/Xutil.h> +#include <sal/log.hxx> + // stuff from glx.h typedef struct __GLXcontextRec *GLXContext; typedef XID GLXPixmap; @@ -275,3 +279,15 @@ bool fire_glxtest_process() *glxtest_pid = pid; return true; } + +void reap_glxtest_process() { + pid_t * pid = getGlxPid(); + if (*pid != 0) { + // Use WNOHANG, as it is probably better to have a (rather harmless) zombie child process + // hanging around for the duration of the calling process, than to potentially block the + // calling process here: + pid_t e = waitpid(*pid, nullptr, WNOHANG); + SAL_INFO_IF( + e <= 0, "vcl.opengl", "waiting for glxtest process " << *pid << " failed with " << e); + } +} |