Ignore:
Timestamp:
Nov 12, 2008, 4:05:27 AM (12 years ago)
Author:
charles
Message:

(libT) don't use getrlimit() / setrlimit() anymore. this doesn't do much good and could possibly do harm wrt fighting with libcurl for available sockets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r7098 r7099  
    2323 *****************************************************************************/
    2424
    25 #ifndef WIN32
    26  #define HAVE_GETRLIMIT
    27 #endif
    28 
    2925#include <assert.h>
    3026#include <errno.h>
     
    4339#include <sys/types.h>
    4440#include <sys/stat.h>
    45 #ifdef HAVE_GETRLIMIT
    46  #include <sys/time.h> /* getrlimit */
    47  #include <sys/resource.h> /* getrlimit */
    48 #endif
    4941#include <unistd.h>
    5042#include <fcntl.h> /* O_LARGEFILE */
     
    509501    gFd = tr_new0( struct tr_fd_s, 1 );
    510502    gFd->lock = tr_lockNew( );
    511 
    512 #ifdef HAVE_GETRLIMIT
    513     {
    514         struct rlimit rlim;
    515         getrlimit( RLIMIT_NOFILE, &rlim );
    516         rlim.rlim_cur = MIN( rlim.rlim_max,
    517                             (rlim_t)( globalPeerLimit + NOFILE_BUFFER ) );
    518         setrlimit( RLIMIT_NOFILE, &rlim );
    519         gFd->socketMax = rlim.rlim_cur - NOFILE_BUFFER;
    520         tr_dbg( "setrlimit( RLIMIT_NOFILE, %d )", (int)rlim.rlim_cur );
    521     }
    522 #else
    523503    gFd->socketMax = globalPeerLimit;
    524 #endif
    525504    tr_dbg( "%d usable file descriptors", globalPeerLimit );
    526505
Note: See TracChangeset for help on using the changeset viewer.