summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nunberg <mnunberg@users.noreply.github.com>2019-01-28 08:57:19 -0500
committerGitHub <noreply@github.com>2019-01-28 08:57:19 -0500
commitc732240152331f33bfe54e8cff451e515ba2fee5 (patch)
tree32ae5eaafe4081c5ae5136feb74f7d3179931e5e
parente6e5a2cba66edfb4b422f996640672e056328380 (diff)
parentbe6bb39fda8cd1fe300e9dfb0fd4d1e598c37435 (diff)
Merge pull request #644 from codehz/codehz-patch-1
Fix Invalid argument after redisAsyncConnectUnix
-rw-r--r--net.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net.c b/net.c
index 4fc5a9d..f09183e 100644
--- a/net.c
+++ b/net.c
@@ -500,6 +500,7 @@ int redisContextConnectUnix(redisContext *c, const char *path, const struct time
return REDIS_ERR;
sa = (struct sockaddr_un*)(c->saddr = malloc(sizeof(struct sockaddr_un)));
+ c->addrlen = sizeof(struct sockaddr_un);
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) {