From e59eef246bd89a1e928ee15096cd5807ecd47e88 Mon Sep 17 00:00:00 2001 From: Matt Stancliff Date: Thu, 24 Apr 2014 15:19:06 -0400 Subject: [PATCH] Add REDIS_BIND_ADDR access macro We need to access (bindaddr[0] || NULL) in a few places, so centralize access with a nice macro. --- src/redis.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/redis.h b/src/redis.h index 0fb40c12..975c8298 100644 --- a/src/redis.h +++ b/src/redis.h @@ -358,6 +358,9 @@ #define REDIS_NOTIFY_EVICTED (1<<9) /* e */ #define REDIS_NOTIFY_ALL (REDIS_NOTIFY_GENERIC | REDIS_NOTIFY_STRING | REDIS_NOTIFY_LIST | REDIS_NOTIFY_SET | REDIS_NOTIFY_HASH | REDIS_NOTIFY_ZSET | REDIS_NOTIFY_EXPIRED | REDIS_NOTIFY_EVICTED) /* A */ +/* Get the first bind addr or NULL */ +#define REDIS_BIND_ADDR (server.bindaddr_count ? server.bindaddr[0] : NULL) + /* Using the following macro you can run code inside serverCron() with the * specified period, specified in milliseconds. * The actual resolution depends on server.hz. */