Skip to content

Commit 03e23c6

Browse files
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
1 parent 0c63e3f commit 03e23c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ int redisContextConnectUnix(redisContext *c, const char *path, const struct time
668668
sa->sun_family = AF_UNIX;
669669
strncpy(sa->sun_path, path, sizeof(sa->sun_path) - 1);
670670
if (connect(c->fd, (struct sockaddr*)sa, sizeof(*sa)) == -1) {
671-
if (errno == EINPROGRESS && !blocking) {
671+
if ((errno == EAGAIN || errno == EINPROGRESS) && !blocking) {
672672
/* This is ok. */
673673
} else {
674674
if (redisContextWaitReady(c,timeout_msec) != REDIS_OK)

0 commit comments

Comments
 (0)