summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-04-06 16:24:22 +0200
committerPaweł Redman <pawel.redman@gmail.com>2017-04-06 16:25:19 +0200
commitabd4bac64d091644236c072be3216caf2fca4de1 (patch)
tree0e3edc4fd1829d9ae97acecb9e073b76563117da
parent965868783e21e37f2eef83ec0c1bd02c3e49fcb3 (diff)
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.
-rw-r--r--src/main.c2
1 files changed, 1 insertions, 1 deletions
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())