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

unlimited select() timeout

mpd sets a 1s select() timeout for no reason. This makes mpd wake up the CPU, consume some cycles just to see there is nothing to do. We can save that by specifying NULL instead of a timeout. git-svn-id: https://svn.musicpd.org/mpd/trunk@7212 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent d78ddd1e
......@@ -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;
......
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