use getdtablesize() to get the max number of fd's

git-svn-id: https://svn.musicpd.org/mpd/trunk@1579 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes 2004-06-20 04:37:17 +00:00
parent 9db4044fbd
commit 5c6765ea52

View File

@ -205,17 +205,9 @@ void parseOptions(int argc, char ** argv, Options * options) {
void closeAllFDs() {
int i;
int fds = getdtablesize();
for(i=0;i<FD_SETSIZE;i++) {
switch(i) {
case STDIN_FILENO:
case STDOUT_FILENO:
case STDERR_FILENO:
break;
default:
close(i);
}
}
for(i = 3; i < fds; i++) close(i);
}
void establishListen(Options * options) {