aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/interface.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/interface.c b/src/interface.c
index 0beffba23..f74d4d41a 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -478,14 +478,11 @@ int doIOForInterfaces(void)
fd_set rfds;
fd_set wfds;
fd_set efds;
- struct timeval tv;
+ struct timeval tv, *tvp = NULL;
int i;
int selret;
int fdmax;
- tv.tv_sec = 1;
- tv.tv_usec = 0;
-
while (1) {
fdmax = 0;
@@ -495,7 +492,7 @@ int doIOForInterfaces(void)
registered_IO_add_fds(&fdmax, &rfds, &wfds, &efds);
- selret = select(fdmax + 1, &rfds, &wfds, &efds, &tv);
+ selret = select(fdmax + 1, &rfds, &wfds, &efds, tvp);
if (selret < 0 && errno == EINTR)
break;
@@ -530,6 +527,7 @@ int doIOForInterfaces(void)
tv.tv_sec = 0;
tv.tv_usec = 0;
+ tvp = &tv;
}
return 1;