[Gnucash-changes] r14392 - gnucash/trunk - Use waitpid() only if <sys/wait.h> is available. Unavailable on win32.

Christian Stimming cstim at cvs.gnucash.org
Tue Jun 20 06:31:01 EDT 2006


Author: cstim
Date: 2006-06-20 06:30:58 -0400 (Tue, 20 Jun 2006)
New Revision: 14392
Trac: http://svn.gnucash.org/trac/changeset/14392

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/configure.in
   gnucash/trunk/src/backend/file/io-gncxml-v2.c
Log:
Use waitpid() only if <sys/wait.h> is available. Unavailable on win32.

Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-06-20 02:17:38 UTC (rev 14391)
+++ gnucash/trunk/ChangeLog	2006-06-20 10:30:58 UTC (rev 14392)
@@ -1,3 +1,8 @@
+2006-06-20  Christian Stimming <stimming at tuhh.de>
+
+	* src/backend/file/io-gncxml-v2.c: Use waitpid() only if
+	<sys/wait.h> is available. Unavailable on win32.
+
 2006-06-18  Chris Lyttle  <chris at wilddev.net>
 
 	* NEWS: Added some text about the release.

Modified: gnucash/trunk/configure.in
===================================================================
--- gnucash/trunk/configure.in	2006-06-20 02:17:38 UTC (rev 14391)
+++ gnucash/trunk/configure.in	2006-06-20 10:30:58 UTC (rev 14392)
@@ -93,7 +93,7 @@
 AC_PROG_LN_S
 AC_HEADER_STDC
 
-AC_CHECK_HEADERS(limits.h sys/times.h)
+AC_CHECK_HEADERS(limits.h sys/times.h sys/wait.h)
 AC_CHECK_FUNCS(stpcpy memcpy timegm towupper)
 AC_CHECK_FUNCS(setenv,,[
   AC_CHECK_FUNCS(putenv,,[

Modified: gnucash/trunk/src/backend/file/io-gncxml-v2.c
===================================================================
--- gnucash/trunk/src/backend/file/io-gncxml-v2.c	2006-06-20 02:17:38 UTC (rev 14391)
+++ gnucash/trunk/src/backend/file/io-gncxml-v2.c	2006-06-20 10:30:58 UTC (rev 14392)
@@ -28,7 +28,9 @@
 #include <unistd.h>
 #include <zlib.h>
 #include <errno.h>
-#include <sys/wait.h>
+#ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
 
 #include "gnc-engine.h"
 #include "gnc-pricedb-p.h"
@@ -1354,7 +1356,15 @@
     if (gzip_child_pid == 0)
         return TRUE;
 
+#ifdef HAVE_SYS_WAIT_H
     retval = waitpid(gzip_child_pid, NULL, WUNTRACED);
+#else
+    /* FIXME: Windows doesn't have waitpid. According to glib's
+       g_spawn_async_with_pipes(), we should use one of the
+       g_spawn functions and some Win32-API WaitFor*() function
+       here. For now, we ignore that race condition. */
+    retval = 1;
+#endif
     gzip_child_pid = 0;
 
     return retval != -1;



More information about the gnucash-changes mailing list