From be6bb39fda8cd1fe300e9dfb0fd4d1e598c37435 Mon Sep 17 00:00:00 2001 From: Code Hz Date: Mon, 28 Jan 2019 21:54:42 +0800 Subject: Fix Invalid argument after redisAsyncConnectUnix --- net.c | 1 + 1 file changed, 1 insertion(+) 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) { -- cgit v1.2.3