From 6ae1a7d438d40b284e188879d07ee8a9d7630541 Mon Sep 17 00:00:00 2001 From: maya Date: Fri, 3 Feb 2017 16:39:15 +0000 Subject: zeromq: fix build on NetBSD. it has SOCK_CLOEXEC, but no accept4. it's expected to use paccept instead. do this. tests 75/78 passing --- net/zeromq/distinfo | 4 +++- net/zeromq/patches/patch-src_ipc__listener.cpp | 18 ++++++++++++++++++ net/zeromq/patches/patch-src_tcp__listener.cpp | 18 ++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 net/zeromq/patches/patch-src_ipc__listener.cpp create mode 100644 net/zeromq/patches/patch-src_tcp__listener.cpp (limited to 'net/zeromq') diff --git a/net/zeromq/distinfo b/net/zeromq/distinfo index e50f98bbae9..bc29bb5bf47 100644 --- a/net/zeromq/distinfo +++ b/net/zeromq/distinfo @@ -1,7 +1,9 @@ -$NetBSD: distinfo,v 1.22 2017/02/02 10:09:53 fhajny Exp $ +$NetBSD: distinfo,v 1.23 2017/02/03 16:39:15 maya Exp $ SHA1 (zeromq-4.2.1.tar.gz) = 2145aef176dbc944822a9b4585273d17e9b9fb7b RMD160 (zeromq-4.2.1.tar.gz) = 888085cca7f16ecd5487f9e518fdc59e5c8672ad SHA512 (zeromq-4.2.1.tar.gz) = 6ef52edff930be34451e81bd21a7e23f08e135c8e10e006d0a6146e7fa4171e9dcf9065f77c33cb0c0db4c16cff4a50cab2a9d612e306490a02bc6a4a913ba6a Size (zeromq-4.2.1.tar.gz) = 1243428 bytes SHA1 (patch-configure) = 5501450e277660d649d53f8a9d753037b4a22f15 +SHA1 (patch-src_ipc__listener.cpp) = 8c5b2c9a3258a57427b0a58ca95dca87bf46f0e8 +SHA1 (patch-src_tcp__listener.cpp) = 9a2781d610989c41697506341ef2bb4dbb416cf1 diff --git a/net/zeromq/patches/patch-src_ipc__listener.cpp b/net/zeromq/patches/patch-src_ipc__listener.cpp new file mode 100644 index 00000000000..9303d32476c --- /dev/null +++ b/net/zeromq/patches/patch-src_ipc__listener.cpp @@ -0,0 +1,18 @@ +$NetBSD: patch-src_ipc__listener.cpp,v 1.1 2017/02/03 16:39:16 maya Exp $ + +NetBSD has SOCK_CLOEXEC -- but uses it with paccept, not accept4 + +--- src/ipc_listener.cpp.orig 2016-12-31 15:25:47.000000000 +0000 ++++ src/ipc_listener.cpp +@@ -391,7 +391,11 @@ zmq::fd_t zmq::ipc_listener_t::accept () + // resources is considered valid and treated by ignoring the connection. + zmq_assert (s != retired_fd); + #if defined ZMQ_HAVE_SOCK_CLOEXEC ++#if defined(__NetBSD__) ++ fd_t sock = ::paccept (s, NULL, NULL, NULL, SOCK_CLOEXEC); ++#else + fd_t sock = ::accept4 (s, NULL, NULL, SOCK_CLOEXEC); ++#endif + #else + fd_t sock = ::accept (s, NULL, NULL); + #endif diff --git a/net/zeromq/patches/patch-src_tcp__listener.cpp b/net/zeromq/patches/patch-src_tcp__listener.cpp new file mode 100644 index 00000000000..9935fdc6c08 --- /dev/null +++ b/net/zeromq/patches/patch-src_tcp__listener.cpp @@ -0,0 +1,18 @@ +$NetBSD: patch-src_tcp__listener.cpp,v 1.1 2017/02/03 16:39:16 maya Exp $ + +NetBSD has SOCK_CLOEXEC, but uses it with paccept, not accept4 + +--- src/tcp_listener.cpp.orig 2016-12-31 15:25:47.000000000 +0000 ++++ src/tcp_listener.cpp +@@ -274,7 +274,11 @@ zmq::fd_t zmq::tcp_listener_t::accept () + socklen_t ss_len = sizeof (ss); + #endif + #if defined ZMQ_HAVE_SOCK_CLOEXEC ++#if defined(__NetBSD__) ++ fd_t sock = ::paccept (s, (struct sockaddr *) &ss, &ss_len, NULL, SOCK_CLOEXEC); ++#else + fd_t sock = ::accept4 (s, (struct sockaddr *) &ss, &ss_len, SOCK_CLOEXEC); ++#endif + #else + fd_t sock = ::accept (s, (struct sockaddr *) &ss, &ss_len); + #endif -- cgit v1.2.3