On Mac OS X getrlimit() returns 2^(sizeof(size_t) * 8) instead of the actual number of available socket descriptors.

This commit is contained in:
Jan Vidar Krey 2010-01-26 08:40:10 +01:00
parent e3cf41cb97
commit 928225fb7b
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ size_t net_get_max_sockets()
struct rlimit limits;
if (getrlimit(RLIMIT_NOFILE, &limits) == 0)
{
return limits.rlim_max;
return MIN(limits.rlim_max, 65536);
}
LOG_ERROR("getrlimit() failed");
return 1024;