summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2014-09-17 18:35:50 +0100
committersin <sin@2f30.org>2014-09-17 18:35:50 +0100
commit6692dbe514e613ed999e219a392d009ddce1e048 (patch)
tree84916068167041646e7925e34cafaac7458fc54d
parent53688edc3d5b03fbee370c720072bd95bc6982a3 (diff)
Fix select() spin
-rw-r--r--ratatox.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/ratatox.c b/ratatox.c
index 8a56ea7..c380e96 100644
--- a/ratatox.c
+++ b/ratatox.c
@@ -1031,7 +1031,7 @@ loop(void)
struct friend *f;
time_t t0, t1;
int connected = 0;
- int i, m, n;
+ int i, n;
int fdmax;
fd_set rfds;
struct timeval tv;
@@ -1061,12 +1061,9 @@ loop(void)
fdmax = STDIN_FILENO;
for (i = 0; i < LEN(gslots); i++) {
- for (m = 0; m < LEN(gfiles); m++) {
- FD_SET(gslots[i].fd[m], &rfds);
- if (gslots[i].fd[m] > fdmax) {
- fdmax = gslots[i].fd[m];
- }
- }
+ FD_SET(gslots[i].fd[IN], &rfds);
+ if (gslots[i].fd[IN] > fdmax)
+ fdmax = gslots[i].fd[IN];
}
TAILQ_FOREACH(f, &friendhead, entry) {