- Timestamp:
- Dec 5, 2010, 6:47:39 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0x/libtransmission/tr-lpd.c
r10714 r11473 32 32 #include <sys/socket.h> /* socket(), bind() */ 33 33 #include <unistd.h> /* close() */ 34 #include <fcntl.h> /* fcntl(), O_NONBLOCK */35 34 #include <ctype.h> /* toupper() */ 36 35 37 36 /* third party */ 38 37 #include <event.h> 38 #include <evutil.h> 39 39 40 40 /* libT */ … … 244 244 245 245 /** 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 /**262 246 * @brief Initializes Local Peer Discovery for this node 263 247 * … … 292 276 293 277 /* enable non-blocking operation */ 294 if( lpd_configureSocket( lpd_socket, O_NONBLOCK ) < 0 )278 if( evutil_make_socket_nonblocking( lpd_socket ) < 0 ) 295 279 goto fail; 296 280 … … 332 316 333 317 /* enable non-blocking operation */ 334 if( lpd_configureSocket( lpd_socket2, O_NONBLOCK ) < 0 )318 if( evutil_make_socket_nonblocking( lpd_socket2 ) < 0 ) 335 319 goto fail; 336 320
Note: See TracChangeset
for help on using the changeset viewer.