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).

Also explicitly install openSSL3 on macOS.

Fixes #1260
  • Loading branch information
michael-grunder committed May 28, 2024
1 parent 2a7b8fa commit e14cf21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:

- name: Install dependencies
run: |
brew install openssl redis@7.2
brew install openssl@3 redis@7.2
brew link redis@7.2 --force
- name: Build hiredis
Expand Down
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 e14cf21

Please sign in to comment.