summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra/socket.c')
-rw-r--r--src/vppinfra/socket.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vppinfra/socket.c b/src/vppinfra/socket.c
index bcee3dea9de..4522514bba9 100644
--- a/src/vppinfra/socket.c
+++ b/src/vppinfra/socket.c
@@ -389,7 +389,7 @@ clib_socket_init (clib_socket_t * s)
struct sockaddr_un su;
} addr;
socklen_t addr_len = 0;
- int socket_type;
+ int socket_type, rv;
clib_error_t *error = 0;
word port;
@@ -502,9 +502,11 @@ clib_socket_init (clib_socket_t * s)
goto done;
}
- if (connect (s->fd, &addr.sa, addr_len) < 0
- && !((s->flags & CLIB_SOCKET_F_NON_BLOCKING_CONNECT) &&
- errno == EINPROGRESS))
+ while ((rv = connect (s->fd, &addr.sa, addr_len)) < 0
+ && errno == EAGAIN)
+ ;
+ if (rv < 0 && !((s->flags & CLIB_SOCKET_F_NON_BLOCKING_CONNECT) &&
+ errno == EINPROGRESS))
{
error = clib_error_return_unix (0, "connect (fd %d, '%s')",
s->fd, s->config);