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 747692 - check build error on osx: pipelines/tcp.c:161:34: error: use of undeclared identifier 'SOCK_CLOEXEC'
check build error on osx: pipelines/tcp.c:161:34: error: use of undeclared id...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Mac OS
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-11 11:57 UTC by Joe Gorse
Modified: 2015-04-26 19:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: use FD_CLOEXEC when SOCK_CLOEXEC is not available (3.74 KB, patch)
2015-04-15 22:21 UTC, Julien Isorce
reviewed Details | Review

Description Joe Gorse 2015-04-11 11:57:30 UTC
The fix is to add:

#ifndef SOCK_CLOEXEC
#define SOCK_CLOEXEC	02000000
#endif
Comment 1 Julien Isorce 2015-04-15 22:21:02 UTC
Created attachment 301686 [details] [review]
tests: use FD_CLOEXEC when SOCK_CLOEXEC is not available

I did not know the problem was already reported so I made another solution based on glib/gio/gsocket.c::g_socket.
Comment 2 Sebastian Dröge (slomo) 2015-04-16 12:05:57 UTC
Review of attachment 301686 [details] [review]:

::: tests/check/pipelines/tcp.c
@@ +36,3 @@
 #include <unistd.h>
 
+#ifndef G_OS_WIN32

And here

@@ +124,3 @@
 }
 
+#ifndef G_OS_WIN32

Shouldn't this be #ifndef SOCK_CLOEXEC for symmetry?

@@ +168,3 @@
     return FALSE;
   }
+#ifndef G_OS_WIN32

And here?
Comment 3 Julien Isorce 2015-04-17 07:37:43 UTC
It seems SOCK_CLOEXEC is not available on G_OS_WIN32.
I simplified a bit https://git.gnome.org/browse/glib/tree/gio/gsocket.c#n454 which also handles the case where SOCK_CLOEXEC is defined in libc header but not available in the kernel: "/* It's possible that libc has SOCK_CLOEXEC but the kernel does not */".
I skipped this as this is a unit test but I can re-add.

Note that I should have put: #if !defined(SOCK_CLOEXEC) && !defined(G_OS_WIN32) instead of just #ifndef G_OS_WIN32 maybe this is your question.
Comment 4 Sebastian Dröge (slomo) 2015-04-17 11:53:41 UTC
Yes, or some explanation why the #ifdefs are inconsistent :) And what happens if neither of those code blocks is actually used.
Comment 5 Tim-Philipp Müller 2015-04-24 20:17:27 UTC
My question is: why is SOCK_CLOEXEC needed here at all? Can't it just be removed?
Comment 6 Will Manley 2015-04-26 19:01:05 UTC
(In reply to Tim-Philipp Müller from comment #5)
> My question is: why is SOCK_CLOEXEC needed here at all? Can't it just be
> removed?

Force of habit I suppose.  I don't think it's necessary.
Comment 7 Tim-Philipp Müller 2015-04-26 19:16:04 UTC
Great, thanks for confirming. Let's keep it simple then:

commit 508ae9c2fc2e7ee89c1a9a2c75129c3189a205ed
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Sun Apr 26 20:13:01 2015 +0100

    tests: tcp: remove SOCK_CLOEXEC which causes build problems on OS/X
    
    It's not needed here.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747692