From f89352aa2862c01fb691e264455f0d253438fbf2 Mon Sep 17 00:00:00 2001 From: nick Date: Thu, 28 Feb 2013 12:14:07 +0000 Subject: [PATCH] Add an explanatory comment in sock_try_connect() --- src/sockutil.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sockutil.c b/src/sockutil.c index 586b37a..9da51da 100644 --- a/src/sockutil.c +++ b/src/sockutil.c @@ -168,9 +168,12 @@ int sock_try_connect( int fd, struct sockaddr* to, socklen_t addrlen, int wait ) break; /* success */ case EAGAIN: case EINTR: - break; /* Try again */ + /* Try connect() again. This only breaks out of the switch, + * not the do...while loop. since result == -1, we go again. + */ + break; default: - warn( SHOW_ERRNO( "Failed to connect()") ); + warn( SHOW_ERRNO( "Failed to connect()" ) ); goto out; } }