summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Stancliff <matt@genges.com>2014-02-19 17:26:33 -0500
committerantirez <antirez@gmail.com>2014-03-11 11:09:37 +0100
commit6f4b5ef6d53a12aa1cd23854028fab478482d8ac (patch)
tree999667b976213f56da0e2eb053cda6127130d0cd
parent4d5ba5962cc178b5e79cce09e763e4af84007983 (diff)
downloadredis-6f4b5ef6d53a12aa1cd23854028fab478482d8ac.tar.gz
Fix "can't bind to address" error reporting.
Report the actual port used for the listening attempt instead of server.port. Originally, Redis would just listen on server.port. But, with clustering, Redis uses a Cluster Port too, so we can't say server.port is always where we are listening. If you tried to launch Redis with a too-high port number (any port where Port+10000 > 65535), Redis would refuse to start, but only print an error saying it can't connect to the Redis port. This patch fixes much confusions.
-rw-r--r--src/redis.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/redis.c b/src/redis.c
index 1219fdbd8..35df416ff 100644
--- a/src/redis.c
+++ b/src/redis.c
@@ -1582,7 +1582,7 @@ int listenToPort(int port, int *fds, int *count) {
redisLog(REDIS_WARNING,
"Creating Server TCP listening socket %s:%d: %s",
server.bindaddr[j] ? server.bindaddr[j] : "*",
- server.port, server.neterr);
+ port, server.neterr);
return REDIS_ERR;
}
(*count)++;