summaryrefslogtreecommitdiffstats
path: root/ax25/axwrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'ax25/axwrapper.c')
-rw-r--r--ax25/axwrapper.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ax25/axwrapper.c b/ax25/axwrapper.c
index e9dcff4..8f2390b 100644
--- a/ax25/axwrapper.c
+++ b/ax25/axwrapper.c
@@ -161,13 +161,22 @@ int main(int argc, char **argv)
while (1) {
FD_ZERO(&fdset);
+ int maxfd = -1;
+
FD_SET(STDIN_FILENO, &fdset);
+ if (STDIN_FILENO > maxfd)
+ maxfd = STDIN_FILENO + 1;
FD_SET(pipe_out[0], &fdset);
+ if (pipe_out[0] > maxfd)
+ maxfd = pipe_out[0] + 1;
FD_SET(pipe_err[0], &fdset);
+ if (pipe_err[0] > maxfd)
+ maxfd = pipe_err[0] + 1;
+
tv.tv_sec = 0;
tv.tv_usec = FLUSHTIMEOUT;
- len = select(256, &fdset, NULL, NULL, &tv);
+ len = select(maxfd, &fdset, NULL, NULL, &tv);
if (len == -1) {
if (errno == EINTR)
continue;