Commit e4779fa7 authored by Max Kellermann's avatar Max Kellermann Committed by Eric Wong

don't repeat select()

The interfaces main loop repeats the select() (non-blocking) after an event was handled. I do not see any reason for that, since all events should be handled after the first select(). This double select() does nothing than consume more CPU cycles. git-svn-id: https://svn.musicpd.org/mpd/trunk@7213 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent f9e317cc
...@@ -478,7 +478,6 @@ int doIOForInterfaces(void) ...@@ -478,7 +478,6 @@ int doIOForInterfaces(void)
fd_set rfds; fd_set rfds;
fd_set wfds; fd_set wfds;
fd_set efds; fd_set efds;
struct timeval tv, *tvp = NULL;
int i; int i;
int selret; int selret;
int fdmax; int fdmax;
...@@ -492,7 +491,7 @@ int doIOForInterfaces(void) ...@@ -492,7 +491,7 @@ int doIOForInterfaces(void)
registered_IO_add_fds(&fdmax, &rfds, &wfds, &efds); registered_IO_add_fds(&fdmax, &rfds, &wfds, &efds);
selret = select(fdmax + 1, &rfds, &wfds, &efds, tvp); selret = select(fdmax + 1, &rfds, &wfds, &efds, NULL);
if (selret < 0 && errno == EINTR) if (selret < 0 && errno == EINTR)
break; break;
...@@ -525,9 +524,7 @@ int doIOForInterfaces(void) ...@@ -525,9 +524,7 @@ int doIOForInterfaces(void)
} }
} }
tv.tv_sec = 0; break;
tv.tv_usec = 0;
tvp = &tv;
} }
return 1; return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment