[Spice-devel] [PATCH spice-server 31/33] replay: Port to Windows

Marc-André Lureau marcandre.lureau at gmail.com
Sat Dec 22 10:18:57 UTC 2018


On Fri, Dec 21, 2018 at 4:04 PM Frediano Ziglio <fziglio at redhat.com> wrote:
>
> Client process termination did not work for Windows, used Win32
> APIs.

ok..

>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau at redhat.com>


> ---
>  server/tests/replay.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/server/tests/replay.c b/server/tests/replay.c
> index c8e10d0a..58630711 100644
> --- a/server/tests/replay.c
> +++ b/server/tests/replay.c
> @@ -210,15 +210,22 @@ static int req_display_notification(QXLInstance *qin)
>
>  static void end_replay(void)
>  {
> -    int child_status;
> -
>      /* FIXME: wait threads and end cleanly */
>      spice_replay_free(replay);
>
>      if (client_pid) {
>          g_debug("kill %" G_PID_FORMAT, client_pid);
> +#ifndef _WIN32
> +        int child_status;
> +
>          kill(client_pid, SIGINT);
>          waitpid(client_pid, &child_status, 0);
> +#else
> +        TerminateProcess(client_pid, 0);
> +        WaitForSingleObject(client_pid, INFINITE);
> +#endif
> +        g_spawn_close_pid(client_pid);
> +        client_pid = 0;
>      }
>  }
>
> --
> 2.17.2
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel



--
Marc-André Lureau


More information about the Spice-devel mailing list