diff options
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/sockhelper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/sockhelper.c b/src/shared/sockhelper.c index 9e9109c..4ff93a6 100644 --- a/src/shared/sockhelper.c +++ b/src/shared/sockhelper.c @@ -61,7 +61,7 @@ int sock_connect(const dnbd3_host_t * const addr, const int connect_ms, const in for ( int i = 0; i < 5; ++i ) { int ret = connect( client_sock, (struct sockaddr *)&ss, addrlen ); e2 = errno; - if ( ret != -1 || errno == EINPROGRESS || errno == EISCONN ) break; + if ( ret != -1 || ( connect_ms == -1 && errno == EINPROGRESS ) || errno == EISCONN ) break; if ( errno == EINTR ) { // http://www.madore.org/~david/computers/connect-intr.html #ifdef __linux__ |