Package: ruby2.0
Version: 2.0.0.299-2
Severity: serious
Tags: patch
User: debian-...@lists.debian.org
Usertags: kfreebsd


Hi,

the current version fails to build on GNU/kFreeBSD, see also
http://lists.debian.org/debian-bsd/2013/09/msg00157.html

Severity serious due to
http://lists.debian.org/debian-bsd/2013/10/msg00070.html

The SOCK_CLOEXEC or SOCK_NONBLOCK are not declared at all
and accept4() prototype is marked as a stub.

I.e. usual configure.ac

        AC_INIT()
        AC_CHECK_FUNCS(accept4)

says

checking for accept4... no

The ruby uses own checking, which does not honour stub marking.
Please either teach it to honour stub marking or
alter ext/socket/init.c as shown bellow.

Thanks

                Petr

--- ext/socket/init.c
+++ ext/socket/init.c
@@ -482,11 +482,11 @@
 {
     int ret;
     socklen_t len0 = 0;
-#ifdef HAVE_ACCEPT4
+#if defined(HAVE_ACCEPT4) && defined(SOCK_CLOEXEC)
     static int try_accept4 = 1;
 #endif
     if (address_len) len0 = *address_len;
-#ifdef HAVE_ACCEPT4
+#if defined(HAVE_ACCEPT4) && defined(SOCK_CLOEXEC)
     if (try_accept4) {
         ret = accept4(socket, address, address_len, SOCK_CLOEXEC);
         /* accept4 is available since Linux 2.6.28, glibc 2.10. */


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to