After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 624754 - gdbusaddress.c missing sys/wait.h
gdbusaddress.c missing sys/wait.h
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
2.25.x
Other Windows
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
: 624788 624828 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-07-19 16:03 UTC by David Hoyt
Modified: 2010-07-22 13:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdbusaddress.c patch (261 bytes, patch)
2010-07-19 16:24 UTC, David Hoyt
none Details | Review
gdbus: Include glib.h (682 bytes, patch)
2010-07-20 08:54 UTC, Emmanuele Bassi (:ebassi)
none Details | Review

Description David Hoyt 2010-07-19 16:03:17 UTC
line 27 (#include <sys/wait.h>) in gio/gdbusaddress.c (in v2.25.11) needs to be guarded with: 

#ifdef G_OS_WIN32
#include <sys/wait.h>
#endif

sys/wait.h doesn't exist on windows (or at least with the mingw-w64 compiler I'm using).

Adding those guards allowed compilation to proceed normally.
Comment 1 David Hoyt 2010-07-19 16:24:16 UTC
Created attachment 166168 [details] [review]
gdbusaddress.c patch
Comment 2 David Zeuthen (not reading bugmail) 2010-07-19 16:57:08 UTC
Wait, shouldn't the  #include be guarded between ifdef G_OS_UNIX instead? I mean, we only use the WIFEXITED and WEXITSTATUS in ifdef G_OS_UNIX code. David, any chance you can try this patch instead?

diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c
index afc8ec6..39fc3bb 100644
--- a/gio/gdbusaddress.c
+++ b/gio/gdbusaddress.c
@@ -24,7 +24,9 @@
 
 #include <stdlib.h>
 #include <string.h>
+#ifdef G_OS_UNIX
 #include <sys/wait.h>
+#endif
 #include <stdio.h>
 #include <errno.h>
Comment 3 David Hoyt 2010-07-19 16:59:12 UTC
Whoops - you're exactly right. Should be #ifndef or what you have -- I did that locally but in creating the patch and submitting my comment I accidentally copied an earlier mistake.
Comment 4 David Hoyt 2010-07-19 17:35:40 UTC
Compiled fine with that patch.
Comment 5 David Zeuthen (not reading bugmail) 2010-07-19 17:54:55 UTC
OK, fixed here: http://git.gnome.org/browse/glib/commit/?id=c7c573afb6eef461bfe70bb848c90b1d58b3d4d9

Thanks.
Comment 6 Emmanuele Bassi (:ebassi) 2010-07-20 08:54:43 UTC
Created attachment 166197 [details] [review]
gdbus: Include glib.h

The G_OS_* defines are provided by glibconfig.h, which comes by
including glib.h.
Comment 7 Frederic Peters 2010-07-20 13:12:39 UTC
*** Bug 624828 has been marked as a duplicate of this bug. ***
Comment 8 Allison Karlitskaya (desrt) 2010-07-20 14:39:35 UTC
*** Bug 624788 has been marked as a duplicate of this bug. ***
Comment 9 Allison Karlitskaya (desrt) 2010-07-20 14:51:47 UTC
fixed this.
Comment 10 sathyz 2010-07-22 13:01:47 UTC
works fine now.