Skip to content

Commit

Permalink
Test for both EAGAIN and EINPROGRESS for AF_UNIX sockets.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
michael-grunder committed Aug 21, 2024
1 parent 0c63e3f commit 329346b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 329346b

Please sign in to comment.