Changeset 11473


Ignore:
Timestamp:
Dec 5, 2010, 6:47:39 PM (11 years ago)
Author:
charles
Message:

(2.0x libtransmission) backport r11357 for #3681 "tr-lpd.c's lpd_configureSocket() function is redundant"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0x/libtransmission/tr-lpd.c

    r10714 r11473  
    3232#include <sys/socket.h> /* socket(), bind() */
    3333#include <unistd.h> /* close() */
    34 #include <fcntl.h> /* fcntl(), O_NONBLOCK */
    3534#include <ctype.h> /* toupper() */
    3635
    3736/* third party */
    3837#include <event.h>
     38#include <evutil.h>
    3939
    4040/* libT */
     
    244244
    245245/**
    246 * @brief Configures additional capabilities for a socket */
    247 static inline int lpd_configureSocket( int sock, int add )
    248 {
    249     /* read-modify-write socket flags */
    250     int flags = fcntl( sock, F_GETFL );
    251 
    252     if( flags < 0 )
    253         return -1;
    254 
    255     if( fcntl( sock, F_SETFL, add | flags ) == -1 )
    256         return -1;
    257 
    258     return add;
    259 }
    260 
    261 /**
    262246* @brief Initializes Local Peer Discovery for this node
    263247*
     
    292276
    293277        /* enable non-blocking operation */
    294         if( lpd_configureSocket( lpd_socket, O_NONBLOCK ) < 0 )
     278        if( evutil_make_socket_nonblocking( lpd_socket ) < 0 )
    295279            goto fail;
    296280
     
    332316
    333317        /* enable non-blocking operation */
    334         if( lpd_configureSocket( lpd_socket2, O_NONBLOCK ) < 0 )
     318        if( evutil_make_socket_nonblocking( lpd_socket2 ) < 0 )
    335319            goto fail;
    336320
Note: See TracChangeset for help on using the changeset viewer.