mirror of
https://github.com/tbamud/tbamud.git
synced 2026-01-09 02:48:50 +01:00
Fix most compiler warnings and fix for OSX.
This commit is contained in:
parent
a61c2c6c60
commit
eadcd45b6e
6 changed files with 15 additions and 8 deletions
11
src/comm.c
11
src/comm.c
|
|
@ -669,8 +669,15 @@ static int get_max_players(void)
|
|||
/* set the current to the maximum */
|
||||
limit.rlim_cur = limit.rlim_max;
|
||||
if (setrlimit(RLIMIT_NOFILE, &limit) < 0) {
|
||||
perror("SYSERR: calling setrlimit");
|
||||
exit(1);
|
||||
#if defined(__APPLE__) && defined(RLIMIT_NOFILE) && defined(OPEN_MAX)
|
||||
/* On OS X, setting rlim_cur above OPEN_MAX fails, so try again
|
||||
* with OPEN_MAX. */
|
||||
limit.rlim_cur = OPEN_MAX;
|
||||
#endif
|
||||
if (setrlimit(RLIMIT_NOFILE, &limit) < 0) {
|
||||
perror("SYSERR: calling setrlimit");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
#ifdef RLIM_INFINITY
|
||||
if (limit.rlim_max == RLIM_INFINITY)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue