[Spice-devel] [PATCH] fix client disconnect

Peter Hatina phatina at redhat.com
Thu May 3 01:25:31 PDT 2012


Hi,

can you, please, have a look at this? Due to script structure
(/usr/libexec/spice-xpi-client), we need to signal a process group
to correctly tear down spicec/remote-viewer. This should fix
rhbz#810583

Thanks,

-Peter

---
 SpiceXPI/src/plugin/plugin.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp
index 9686ca5..349b483 100644
--- a/SpiceXPI/src/plugin/plugin.cpp
+++ b/SpiceXPI/src/plugin/plugin.cpp
@@ -682,6 +682,8 @@ void nsPluginInstance::Connect()
     m_pid_controller = fork();
     if (m_pid_controller == 0)
     {
+        setpgrp();
+
         char *spice_xpi_client_args[] = {
             const_cast<char*>("/usr/libexec/spice-xpi-client"),
             NULL
@@ -808,7 +810,7 @@ void nsPluginInstance::Disconnect()
 {
     LOG_INFO("Disconnecting");
     if (m_pid_controller > 0)
-        kill(m_pid_controller, SIGTERM);
+        kill(-m_pid_controller, SIGTERM);
     if (m_pid_usbrdrctrl > 0)
         kill(m_pid_usbrdrctrl, SIGTERM);
 }
-- 
1.7.1



More information about the Spice-devel mailing list