Ignore:
Timestamp:
May 15, 2009, 12:19:27 PM (13 years ago)
Author:
charles
Message:

(trunk libT) fix a minor bug in peer count tabulation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.c

    r8403 r8407  
    327327
    328328    if( evutil_make_socket_nonblocking( s ) < 0 ) {
    329         EVUTIL_CLOSESOCKET( s );
     329        tr_netClose( s );
    330330        return -1;
    331331    }
     
    395395    if( addr->type == TR_AF_INET6 )
    396396        if( setsockopt( fd, IPPROTO_IPV6, IPV6_V6ONLY, &optval, sizeof( optval ) ) == -1 )
    397             if( EVUTIL_SOCKET_ERROR( ) != ENOPROTOOPT ) /* if the kernel doesn't support it, ignore it */
    398                 return -EVUTIL_SOCKET_ERROR( );
     397            if( sockerr != ENOPROTOOPT ) /* if the kernel doesn't support it, ignore it */
     398                return -sockerr;
    399399#endif
    400400
    401401    addrlen = setup_sockaddr( addr, htons( port ), &sock );
    402402    if( bind( fd, (struct sockaddr *) &sock, addrlen ) ) {
    403         const int err = EVUTIL_SOCKET_ERROR( );
     403        const int err = sockerr;
    404404        if( !suppressMsgs )
    405405            tr_err( _( "Couldn't bind port %d on %s: %s" ),
     
    414414    if( listen( fd, 128 ) == -1 ) {
    415415        EVUTIL_CLOSESOCKET( fd );
    416         return -EVUTIL_SOCKET_ERROR( );
     416        return -sockerr;
    417417    }
    418418
     
    429429
    430430    if( fd>=0 && evutil_make_socket_nonblocking(fd)<0 ) {
    431         EVUTIL_CLOSESOCKET( fd );
     431        tr_netClose( fd );
    432432        fd = -1;
    433433    }
Note: See TracChangeset for help on using the changeset viewer.