diff mbox series

[ovs-dev,v2,4/4] Handle EAGAIN on unix socket connect() failure

Message ID 20231118010703.4154866-5-ihrachys@redhat.com
State Changes Requested
Delegated to: Simon Horman
Headers show
Series Improve unixctl AF_UNIX backlog handling | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Ihar Hrachyshka Nov. 18, 2023, 1:07 a.m. UTC
While POSIX document EINPROGRESS, Linux connect() system call returns
EAGAIN for nonblocking Unix sockets instead. This patch handles this
case by repeating connect() attempts.

Signed-off-by: Ihar Hrachyshka <ihrachys@redhat.com>
---
 lib/socket-util-unix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/socket-util-unix.c b/lib/socket-util-unix.c
index 230705ba3..44ec16bce 100644
--- a/lib/socket-util-unix.c
+++ b/lib/socket-util-unix.c
@@ -366,7 +366,7 @@  make_unix_socket(int style, bool nonblock,
                 if (!connect(fd, (struct sockaddr *)&un, un_len)) {
                     break;
                 }
-                if (errno != EINPROGRESS) {
+                if (errno != EAGAIN && errno != EINPROGRESS) {
                     error = errno;
                     break;
                 }