summaryrefslogtreecommitdiff
path: root/hiredis.c
diff options
context:
space:
mode:
authorAlex Balashov <abalashov@evaristesys.com>2015-04-30 15:01:31 -0400
committerAlex Balashov <abalashov@evaristesys.com>2015-04-30 15:01:31 -0400
commitd132d676e918355bb33e5ac8b346f678a7dce0e9 (patch)
tree76cb4c5383809ac240599cfc738a50ad8b0a100e /hiredis.c
parentb9f907fb4c1ce5280f26f61d611b9fcedcf6add4 (diff)
Renamed redisContext struct member 'unix' to 'unix_sock' to avoid encountering defined constant 'unix' in GNU C environment (see commit d8145d79ce715054980938c751067ebaa541573c).
Not all code using hiredis can compile using '-std=c99', and/or not all users are able to easily make that change to the build process of various open-source projects, so it is more pragmatic to choose a different identifier that does not impose this requirement.
Diffstat (limited to 'hiredis.c')
-rw-r--r--hiredis.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hiredis.c b/hiredis.c
index c70ea39..73d0251 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -602,7 +602,7 @@ static redisContext *redisContextInit(void) {
c->reader = redisReaderCreate();
c->tcp.host = NULL;
c->tcp.source_addr = NULL;
- c->unix.path = NULL;
+ c->unix_sock.path = NULL;
c->timeout = NULL;
if (c->obuf == NULL || c->reader == NULL) {
@@ -626,8 +626,8 @@ void redisFree(redisContext *c) {
free(c->tcp.host);
if (c->tcp.source_addr)
free(c->tcp.source_addr);
- if (c->unix.path)
- free(c->unix.path);
+ if (c->unix_sock.path)
+ free(c->unix_sock.path);
if (c->timeout)
free(c->timeout);
free(c);
@@ -658,7 +658,7 @@ int redisReconnect(redisContext *c) {
return redisContextConnectBindTcp(c, c->tcp.host, c->tcp.port,
c->timeout, c->tcp.source_addr);
} else if (c->connection_type == REDIS_CONN_UNIX) {
- return redisContextConnectUnix(c, c->unix.path, c->timeout);
+ return redisContextConnectUnix(c, c->unix_sock.path, c->timeout);
} else {
/* Something bad happened here and shouldn't have. There isn't
enough information in the context to reconnect. */