From cc8befc2000bd401debe298aa061a158eab8f623 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Tue, 31 Jan 2012 20:03:54 +0100 Subject: Add SPICE_XPI_DEBUG to not follow childs die and easier debugging Spice XPI assumes that the client is the child PID, however for debugging reasons, it's useful to spawn the client as a sub process of the launched program. This allows clients such as: #!/bin/sh exec gnome-terminal -e "gdb --args spicec --controller $@" --- SpiceXPI/src/plugin/plugin.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'SpiceXPI') diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp index 816ac63..e982b17 100644 --- a/SpiceXPI/src/plugin/plugin.cpp +++ b/SpiceXPI/src/plugin/plugin.cpp @@ -747,13 +747,15 @@ void nsPluginInstance::CallOnDisconnected(int code) void nsPluginInstance::SigchldRoutine(int sig, siginfo_t *info, void *uap) { LOG_DEBUG("child finished, pid: " << info->si_pid); - int exit_code; waitpid(info->si_pid, &exit_code, 0); - nsPluginInstance *fake_this = s_children[info->si_pid]; - fake_this->CallOnDisconnected(exit_code); - fake_this->m_external_controller.Disconnect(); + if (!getenv("SPICE_XPI_DEBUG")) { + nsPluginInstance *fake_this = s_children[info->si_pid]; + fake_this->CallOnDisconnected(exit_code); + fake_this->m_external_controller.Disconnect(); + } + s_children.erase(info->si_pid); } -- cgit v1.2.3