From e4f52b8c852d4e7efd7555e66ace737ab9f7a8dc Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Wed, 4 Jun 2014 14:44:30 +0200
Subject: Add missing include.


diff --git a/src/netserver.c b/src/netserver.c
index 9534722..76bdece 100644
--- a/src/netserver.c
+++ b/src/netserver.c
@@ -75,6 +75,8 @@ char	netserver_id[]="\
 #include <sys/ioctl.h>
 #endif
 
+#include <sys/select.h>
+
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
-- 
2.30.2


From b9383c24f576dfece6a0e8e417f6c7ef51194f29 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Sat, 30 Oct 2021 17:43:22 +0200
Subject: fix for -lnetwork


diff --git a/configure.ac b/configure.ac
index 4c01090..2cba13b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,6 +48,8 @@ if test "$ac_cv_lib_socket_main" = yes ; then
     AC_SYS_LARGEFILE
 fi
 
+AC_CHECK_LIB([network], [socket])
+
 # this one is for Tru64 and bind_to_cpu_id
 AC_HAVE_LIBRARY(mach)
 
-- 
2.30.2


From f8ffc65f6d8094407c45265c701134d79ac63173 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Tue, 2 Nov 2021 10:19:48 +0100
Subject: fix select in netlib


diff --git a/src/netlib.c b/src/netlib.c
index f3a3fe5..bff7cc8 100644
--- a/src/netlib.c
+++ b/src/netlib.c
@@ -2247,7 +2247,7 @@ shutdown_control()
 
   /* select had better return one, or there was either a problem or a
      timeout... */
-  if (select(FD_SETSIZE,
+  if (select(netlib_control+1,
              &readfds,
              0,
              0,
@@ -2691,7 +2691,7 @@ recv_request_timed_n(int n, int seconds)
   do {
     FD_ZERO(&readfds);
     FD_SET(server_sock,&readfds);
-    if (select(FD_SETSIZE,
+    if (select(server_sock+1,
 	       &readfds,
 	       0,
 	       0,
@@ -2867,7 +2867,7 @@ recv_response_timed_n(int addl_time, int n)
   /* select had better return one, or there was either a problem or a */
   /* timeout... */
 
-  if ((counter = select(FD_SETSIZE,
+  if ((counter = select(netlib_control+1,
 			&readfds,
 			0,
 			0,
-- 
2.30.2

