summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2012-01-31 20:03:54 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2012-01-31 20:11:48 +0100
commitcc8befc2000bd401debe298aa061a158eab8f623 (patch)
treee835beaff1bc5ef4615f2fd5a23203992f03a5ce
parent89ac88d9fffd0ec0be4f56c32e74fcdab9fc9125 (diff)
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 $@"
-rw-r--r--SpiceXPI/src/plugin/plugin.cpp10
1 files changed, 6 insertions, 4 deletions
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);
}