From 329346bb64132e88dc6512e90ff6d8eefbd8b2fb Mon Sep 17 00:00:00 2001 From: michael-grunder Date: Mon, 27 May 2024 10:06:45 -0700 Subject: [PATCH] Test for both EAGAIN and EINPROGRESS for AF_UNIX sockets. Reading the manpage it seems like we only need to test for `EAGAIN` but testing for both seems more prudent since this may be subtly different on more esoteric kernels (SunOS, AIX, BSD, etc). Fixes #1260 --- net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net.c b/net.c index 8b7831e35..b514babaf 100644 --- a/net.c +++ b/net.c @@ -668,7 +668,7 @@ int redisContextConnectUnix(redisContext *c, const char *path, const struct time sa->sun_family = AF_UNIX; strncpy(sa->sun_path, path, sizeof(sa->sun_path) - 1); if (connect(c->fd, (struct sockaddr*)sa, sizeof(*sa)) == -1) { - if (errno == EINPROGRESS && !blocking) { + if ((errno == EAGAIN || errno == EINPROGRESS) && !blocking) { /* This is ok. */ } else { if (redisContextWaitReady(c,timeout_msec) != REDIS_OK)