GNOME Bugzilla – Bug 525228
_GNU_SOURCE / struct ucred with recent libc
Last modified: 2010-07-15 07:35:14 UTC
With recent GNU libc, 'struct ucred' isn't defined unless _GNU_SOURCE is defined, causing fatal compilation errors in gam_channel.c and gam_api.c. The workaround would be something like #ifdef LINUX #define _GNU_SOURCE #include <sys/socket.h> #undef _GNU_SOURCE #else #include <sys/socket.h> #endif in both files, or a simpler unconditional #define _GNU_SOURCE at the top, but I haven't researched whether there is some other "approved" way you are supposed to use SCM_CREDENTIALS. "Recent GNU libc" is on my (Fedora 9 beta) system 2.7.90.
This will also work: --- configure.in (revision 329) +++ configure.in (working copy) @@ -4,6 +4,9 @@ AM_CONFIG_HEADER(config.h) AC_CANONICAL_SYSTEM +# for ucred +AC_GNU_SOURCE + # get any external flags setting before we start playing with the CFLAGS variable ENV_CFLAGS="$CFLAGS"
I think keeping the GNU_SOURCE definition as close as possible to where it is used is a good idea... in terms of a) making things not break if code is moved elsewhere b) keeping stray non-portable things from creaping in.
Just fyi, here is the patch that was applied to Fedora: http://cvs.fedoraproject.org/viewcvs/rpms/gamin/F-9/gamin-0.1.9-ucred-headers.patch?rev=1.1&view=markup
Can we get this in please? And make a release with it? This is breaking the build for me when trying to release GNOME 2.22.3.
*** Bug 534942 has been marked as a duplicate of this bug. ***
I ask for a non-maintainer release. I Just run into this too with 0.1.9, http://svn.gnome.org/viewvc/gamin?view=revision&revision=330 fixed it for me.
*** Bug 548603 has been marked as a duplicate of this bug. ***
*** Bug 558909 has been marked as a duplicate of this bug. ***
This fix as per comment #6 was released in 0.1.10.