diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-04-06 16:24:22 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-04-06 16:25:19 +0200 |
commit | abd4bac64d091644236c072be3216caf2fca4de1 (patch) | |
tree | 0e3edc4fd1829d9ae97acecb9e073b76563117da | |
parent | 965868783e21e37f2eef83ec0c1bd02c3e49fcb3 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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()) |