From 433a0cd5e286124e7282c82ee258b9a4f960285d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6hler?= Date: Sat, 28 Apr 2007 16:04:06 +0000 Subject: [PATCH] Give the child process a real chance to die before we kill it. Improve r15997 by processing all events without blocking, maybe until the child is dead. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16015 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/app-utils/guile-util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app-utils/guile-util.c b/src/app-utils/guile-util.c index 476e14ad2d..f592b3f1cd 100644 --- a/src/app-utils/guile-util.c +++ b/src/app-utils/guile-util.c @@ -1278,9 +1278,10 @@ gnc_detach_process (Process *proc, const gboolean kill_it) errno = 0; } - if (kill_it) { + if (kill_it && !proc->dead) { /* give it a chance to die */ - g_main_context_iteration (NULL, FALSE); + while (g_main_context_iteration (NULL, FALSE) && !proc->dead) + ; if (!proc->dead) gnc_gpid_kill (proc->pid); }