From 1d9f055dc7baacd41d6f5f8be7d8176eae998bde Mon Sep 17 00:00:00 2001 From: nick Date: Thu, 28 Feb 2013 12:07:21 +0000 Subject: [PATCH] Turn a couple of FIXME fatals in readwrite.c into warnings --- src/readwrite.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/readwrite.c b/src/readwrite.c index bb971ce..f9e8208 100644 --- a/src/readwrite.c +++ b/src/readwrite.c @@ -17,16 +17,20 @@ int socket_connect(struct sockaddr* to, struct sockaddr* from) } if (NULL != from) { - if ( 0 > bind(fd, from, sizeof(struct sockaddr_in6)) ){ - warn( "bind() failed"); - FATAL_IF_NEGATIVE( close( fd ), SHOW_ERRNO( "FIXME" ) ); + if ( 0 > bind( fd, from, sizeof(struct sockaddr_in6 ) ) ){ + warn( SHOW_ERRNO( "bind() to source address failed" ) ); + if ( 0 > close( fd ) ) { /* Non-fatal leak */ + warn( SHOW_ERRNO( "Failed to close fd %i", fd ) ); + } return -1; } } if ( 0 > sock_try_connect( fd, to, sizeof( struct sockaddr_in6 ), 15 ) ) { warn( SHOW_ERRNO( "connect failed" ) ); - FATAL_IF_NEGATIVE( close( fd ), SHOW_ERRNO( "FIXME" ) ); + if ( 0 > close( fd ) ) { /* Non-fatal leak */ + warn( SHOW_ERRNO( "Failed to close fd %i", fd ) ); + } return -1; }