mirror of
https://github.com/transmission/transmission
synced 2024-12-26 01:27:28 +00:00
avoid an extra comparison caused by macro expansion
This commit is contained in:
parent
25a023023f
commit
a7245651f2
1 changed files with 2 additions and 1 deletions
|
@ -832,7 +832,8 @@ tr_fdSetPeerLimit( tr_session * session, int socketLimit )
|
|||
const int NOFILE_BUFFER = 512;
|
||||
const int open_max = sysconf( _SC_OPEN_MAX );
|
||||
getrlimit( RLIMIT_NOFILE, &rlim );
|
||||
rlim.rlim_cur = MIN( MAX( 1024, open_max ), rlim.rlim_max );
|
||||
rlim.rlim_cur = MAX( 1024, open_max );
|
||||
rlim.rlim_cur = MIN( rlim.rlim_cur, rlim.rlim_max );
|
||||
setrlimit( RLIMIT_NOFILE, &rlim );
|
||||
tr_dbg( "setrlimit( RLIMIT_NOFILE, %d )", (int)rlim.rlim_cur );
|
||||
gFd->socketLimit = MIN( socketLimit, (int)rlim.rlim_cur - NOFILE_BUFFER );
|
||||
|
|
Loading…
Reference in a new issue