[Spice-commits] SpiceXPI/src

Marc-André Lureau elmarco at kemper.freedesktop.org
Wed Feb 1 02:27:30 PST 2012


 SpiceXPI/src/plugin/plugin.cpp |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit cc8befc2000bd401debe298aa061a158eab8f623
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Tue Jan 31 20:03:54 2012 +0100

    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 $@"

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);
 }
 


More information about the Spice-commits mailing list