[gegl] gegl: Don't kill processes on windows within pid_is_running in gegl_init.c
- From: Michael Henning <mhenning src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] gegl: Don't kill processes on windows within pid_is_running in gegl_init.c
- Date: Sat, 19 Oct 2013 18:36:04 +0000 (UTC)
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]