[gegl] gegl: Don't kill processes on windows within pid_is_running in gegl_init.c



commit 4cf48ed60ccad8b9133cffd855e52c68c13bc3a6
Author: Michael Henning <drawoc darkrefraction com>
Date:   Sat Oct 19 14:12:59 2013 -0400

    gegl: Don't kill processes on windows within pid_is_running in gegl_init.c
    
    Originally spotted by Massimo.

 gegl/gegl-init.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gegl/gegl-init.c b/gegl/gegl-init.c
index 9ee57b7..0df75ed 100644
--- a/gegl/gegl-init.c
+++ b/gegl/gegl-init.c
@@ -59,9 +59,13 @@ static inline gboolean
 pid_is_running (gint pid)
 {
   HANDLE h;
+  DWORD exitcode = 0;
 
-  h = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
-  return (TerminateProcess(h, 0));
+  h = OpenProcess (PROCESS_QUERY_INFORMATION, FALSE, pid);
+  GetExitCodeProcess (h, &exitcode);
+  CloseHandle (h);
+
+  return exitcode == STILL_ACTIVE;
 }
 
 #else


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