r16015 - gnucash/trunk/src/app-utils - Give the child process a real chance to die before we kill it.

Andreas Köhler andi5 at cvs.gnucash.org
Sat Apr 28 12:04:07 EDT 2007


Author: andi5
Date: 2007-04-28 12:04:06 -0400 (Sat, 28 Apr 2007)
New Revision: 16015
Trac: http://svn.gnucash.org/trac/changeset/16015

Modified:
   gnucash/trunk/src/app-utils/guile-util.c
Log:
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.


Modified: gnucash/trunk/src/app-utils/guile-util.c
===================================================================
--- gnucash/trunk/src/app-utils/guile-util.c	2007-04-28 15:32:51 UTC (rev 16014)
+++ gnucash/trunk/src/app-utils/guile-util.c	2007-04-28 16:04:06 UTC (rev 16015)
@@ -1278,9 +1278,10 @@
     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);
   }



More information about the gnucash-changes mailing list