summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/sockhelper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/sockhelper.c b/src/shared/sockhelper.c
index ab34aa1..582420a 100644
--- a/src/shared/sockhelper.c
+++ b/src/shared/sockhelper.c
@@ -58,7 +58,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 );
- 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__