[PATCH spice-server v3 30/32] replay: Port to Windows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Client process termination did not work for Windows, used Win32
APIs.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
Reviewed-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
---
 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 b88c03c7..6367ce21 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.20.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]