From abd4bac64d091644236c072be3216caf2fca4de1 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Thu, 6 Apr 2017 16:24:22 +0200 Subject: Fix the select call in main. The first argument is supposed to be the maximum of all fds plus one, not the number of the fds. --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index c10ec68..6303a70 100644 --- a/src/main.c +++ b/src/main.c @@ -226,7 +226,7 @@ int main(void) // select (not recvfrom). Furthermore, select will return if // gets interrupted by a signal, which is main loop breaking // can be easily implemented. - rv = select(1, &readfds, NULL, NULL, NULL); + rv = select(server_sockfd + 1, &readfds, NULL, NULL, NULL); if (rv == -1 && errno == EINTR) { interrupted_select: if (handle_signals()) -- cgit