pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/bind916 bind916: fix builds on Solaris derivates



details:   https://anonhg.NetBSD.org/pkgsrc/rev/37d5e4e061c3
branches:  trunk
changeset: 374261:37d5e4e061c3
user:      gutteridge <gutteridge%pkgsrc.org@localhost>
date:      Thu Feb 17 15:37:26 2022 +0000

description:
bind916: fix builds on Solaris derivates

A patch fixing SunOS builds was lost during a recent update, restore
it. (And s/SmartOS/SunOS/ in comment, this doesn't just affect SmartOS,
reproduced and fixed on OmniOS. This package also fails to build on
Linux, but that's another issue entirely.) Addresses PR pkg/56716 from
Russell Hansen.

diffstat:

 net/bind916/distinfo                            |   4 +-
 net/bind916/patches/patch-lib_isc_unix_socket.c |  56 ++++++++++++++++--------
 2 files changed, 38 insertions(+), 22 deletions(-)

diffs (190 lines):

diff -r 04ca7942e325 -r 37d5e4e061c3 net/bind916/distinfo
--- a/net/bind916/distinfo      Thu Feb 17 11:59:24 2022 +0000
+++ b/net/bind916/distinfo      Thu Feb 17 15:37:26 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.30 2022/01/27 13:35:36 taca Exp $
+$NetBSD: distinfo,v 1.31 2022/02/17 15:37:26 gutteridge Exp $
 
 BLAKE2s (bind-9.16.25.tar.xz) = d0db703c77f4bd1739a38360da679b9f0cc85712c027e93ff3af91a6279cbfc4
 SHA512 (bind-9.16.25.tar.xz) = e43c0e59159d3a5642db051f3982d8767fb726426380c32960fefe4b9afd05708ed8f7e80a98b803a580b048e1a368c888e2dd5695fa5fcd7b8b75574a27cb62
@@ -48,7 +48,7 @@
 SHA1 (patch-lib_isc_timer.c) = aea2019bbf3d84cad77af432a2bbdf0da8f2f893
 SHA1 (patch-lib_isc_unix_include_isc_stdatomic.h) = b73b0224be47c1733f6346fce9243e97f54e1865
 SHA1 (patch-lib_isc_unix_net.c) = c654f60a1feefdba9bf980dcfa46ce37f46918aa
-SHA1 (patch-lib_isc_unix_socket.c) = 7d5b61124187009ce03f4fc963f8ad3c44d267d0
+SHA1 (patch-lib_isc_unix_socket.c) = c6d04164dfc2047493b39c174bbdf2c8aa59bc1d
 SHA1 (patch-lib_isc_unix_time.c) = fac9e66754e099f53ba8c499f5f179825a0b0fbd
 SHA1 (patch-lib_ns_Makefile.in) = 7375d0cb44c891492594dc7540f78826c141106a
 SHA1 (patch-lib_ns_client.c) = 099ca607278d064081a0cfc92d96f0b31d95a944
diff -r 04ca7942e325 -r 37d5e4e061c3 net/bind916/patches/patch-lib_isc_unix_socket.c
--- a/net/bind916/patches/patch-lib_isc_unix_socket.c   Thu Feb 17 11:59:24 2022 +0000
+++ b/net/bind916/patches/patch-lib_isc_unix_socket.c   Thu Feb 17 15:37:26 2022 +0000
@@ -1,12 +1,28 @@
-$NetBSD: patch-lib_isc_unix_socket.c,v 1.6 2021/10/24 06:40:28 taca Exp $
+$NetBSD: patch-lib_isc_unix_socket.c,v 1.7 2022/02/17 15:37:26 gutteridge Exp $
 
 * Apply fixes from NetBSD base system.
-* Fix build on SmartOS. In this special case, _XOPEN_SOURCE has to be only
-  defined on SmartOS.
+* Fix build on SunOS. In this special case, _XOPEN_SOURCE has to be only
+  defined on SunOS.
 
---- lib/isc/unix/socket.c.orig 2021-09-07 09:37:05.000000000 +0000
+--- lib/isc/unix/socket.c.orig 2022-01-12 13:50:10.000000000 +0000
 +++ lib/isc/unix/socket.c
-@@ -360,6 +360,10 @@ struct isc_socket {
+@@ -13,6 +13,15 @@
+ 
+ /*! \file */
+ 
++/* needed for CMSG_DATA */
++#if defined(__sun)
++#if (__STDC_VERSION__ - 0 < 199901L)
++#define _XOPEN_SOURCE 500
++#else
++#define _XOPEN_SOURCE 600
++#endif
++#endif
++
+ #include <inttypes.h>
+ #include <stdbool.h>
+ #include <sys/param.h>
+@@ -362,6 +371,10 @@ struct isc_socket {
        unsigned char overflow; /* used for MSG_TRUNC fake */
  #endif                                /* ifdef ISC_PLATFORM_RECVOVERFLOW */
  
@@ -17,7 +33,7 @@
        unsigned int dscp;
  };
  
-@@ -469,6 +473,14 @@ static bool
+@@ -471,6 +484,14 @@ static bool
  process_ctlfd(isc__socketthread_t *thread);
  static void
  setdscp(isc_socket_t *sock, isc_dscp_t dscp);
@@ -32,7 +48,7 @@
  
  #define SELECT_POKE_SHUTDOWN (-1)
  #define SELECT_POKE_NOTHING  (-2)
-@@ -1573,6 +1585,7 @@ doio_recv(isc_socket_t *sock, isc_socket
+@@ -1574,6 +1595,7 @@ doio_recv(isc_socket_t *sock, isc_socket
        case isc_sockettype_udp:
        case isc_sockettype_raw:
                break;
@@ -40,7 +56,7 @@
        default:
                INSIST(0);
                ISC_UNREACHABLE();
-@@ -1781,9 +1794,26 @@ socketclose(isc__socketthread_t *thread,
+@@ -1782,9 +1804,26 @@ socketclose(isc__socketthread_t *thread,
         */
        LOCK(&thread->fdlock[lockid]);
        thread->fds[fd] = NULL;
@@ -68,7 +84,7 @@
  
        inc_stats(thread->manager->stats, sock->statsindex[STATID_CLOSE]);
  
-@@ -2190,6 +2220,13 @@ again:
+@@ -2191,6 +2230,13 @@ again:
                        }
  #endif /* if defined(PF_ROUTE) */
                        break;
@@ -82,7 +98,7 @@
                }
        } else {
                sock->fd = dup(dup_socket->fd);
-@@ -2439,6 +2476,7 @@ socket_create(isc_socketmgr_t *manager, 
+@@ -2440,6 +2486,7 @@ socket_create(isc_socketmgr_t *manager,
  
        REQUIRE(VALID_MANAGER(manager));
        REQUIRE(socketp != NULL && *socketp == NULL);
@@ -90,7 +106,7 @@
  
        result = allocate_socket(manager, type, &sock);
        if (result != ISC_R_SUCCESS) {
-@@ -2553,6 +2591,7 @@ isc_socket_open(isc_socket_t *sock) {
+@@ -2554,6 +2601,7 @@ isc_socket_open(isc_socket_t *sock) {
        REQUIRE(isc_refcount_current(&sock->references) >= 1);
        REQUIRE(sock->fd == -1);
        REQUIRE(sock->threadid == -1);
@@ -98,7 +114,7 @@
  
        result = opensocket(sock->manager, sock, NULL);
  
-@@ -2631,6 +2670,7 @@ isc_socket_close(isc_socket_t *sock) {
+@@ -2632,6 +2680,7 @@ isc_socket_close(isc_socket_t *sock) {
  
        LOCK(&sock->lock);
  
@@ -106,7 +122,7 @@
        REQUIRE(sock->fd >= 0 && sock->fd < (int)sock->manager->maxsocks);
  
        INSIST(!sock->connecting);
-@@ -2661,6 +2701,24 @@ isc_socket_close(isc_socket_t *sock) {
+@@ -2662,6 +2711,24 @@ isc_socket_close(isc_socket_t *sock) {
        return (ISC_R_SUCCESS);
  }
  
@@ -131,7 +147,7 @@
  /*
   * Dequeue an item off the given socket's read queue, set the result code
   * in the done event to the one provided, and send it to the task it was
-@@ -3101,6 +3159,58 @@ finish:
+@@ -3102,6 +3169,58 @@ finish:
        }
  }
  
@@ -190,7 +206,7 @@
  /*
   * Process read/writes on each fd here.  Avoid locking
   * and unlocking twice if both reads and writes are possible.
-@@ -3148,7 +3258,7 @@ process_fd(isc__socketthread_t *thread, 
+@@ -3149,7 +3268,7 @@ process_fd(isc__socketthread_t *thread,
                if (sock->connecting) {
                        internal_connect(sock);
                } else {
@@ -199,7 +215,7 @@
                }
        }
  
-@@ -3156,7 +3266,7 @@ process_fd(isc__socketthread_t *thread, 
+@@ -3157,7 +3276,7 @@ process_fd(isc__socketthread_t *thread,
                if (sock->listener) {
                        internal_accept(sock); /* unlocks sock */
                } else {
@@ -208,7 +224,7 @@
                        UNLOCK(&sock->lock);
                }
        } else {
-@@ -3797,7 +3907,7 @@ isc_socketmgr_create2(isc_mem_t *mctx, i
+@@ -3798,7 +3917,7 @@ isc_socketmgr_create2(isc_mem_t *mctx, i
                isc_thread_create(netthread, &manager->threads[i],
                                  &manager->threads[i].thread);
                char tname[1024];
@@ -217,7 +233,7 @@
                isc_thread_setname(manager->threads[i].thread, tname);
        }
  
-@@ -5218,7 +5328,7 @@ static isc_once_t hasreuseport_once = IS
+@@ -5219,7 +5338,7 @@ static isc_once_t hasreuseport_once = IS
  static bool hasreuseport = false;
  
  static void
@@ -226,7 +242,7 @@
  /*
   * SO_REUSEPORT works very differently on *BSD and on Linux (because why not).
   * We only want to use it on Linux, if it's available. On BSD we want to dup()
-@@ -5272,6 +5382,8 @@ _socktype(isc_sockettype_t type) {
+@@ -5273,6 +5392,8 @@ _socktype(isc_sockettype_t type) {
                return ("tcp");
        case isc_sockettype_unix:
                return ("unix");
@@ -235,7 +251,7 @@
        default:
                return ("not-initialized");
        }
-@@ -5502,3 +5614,113 @@ error:
+@@ -5503,3 +5624,113 @@ error:
        return (result);
  }
  #endif /* HAVE_JSON_C */



Home | Main Index | Thread Index | Old Index