[Spice-devel] [PATCH] fix client disconnect

Hans de Goede hdegoede at redhat.com
Thu May 3 02:41:48 PDT 2012


Hi,

On 05/03/2012 10:25 AM, Peter Hatina wrote:
> 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

Ah, I see this is caused by the piping to logger to log any
output, which causes there to be multiple processes.

ACK.

Regards,

Hans



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


More information about the Spice-devel mailing list