interface: use a saner fdmax for select(2) when closing errored interfaces

git-svn-id: https://svn.musicpd.org/mpd/trunk@7218 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Eric Wong 2008-03-26 10:39:07 +00:00
parent 232c9f6c41
commit 19d4f6df18
1 changed files with 2 additions and 1 deletions

View File

@ -462,7 +462,8 @@ static void closeNextErroredInterface(void)
if (interfaces[i].fd >= 0) {
FD_ZERO(&fds);
FD_SET(interfaces[i].fd, &fds);
if (select(FD_SETSIZE, &fds, NULL, NULL, &tv) < 0) {
if (select(interfaces[i].fd + 1,
&fds, NULL, NULL, &tv) < 0) {
closeInterface(&interfaces[i]);
return;
}