From: antirez Date: Mon, 7 Feb 2011 12:43:29 +0000 (+0100) Subject: Fix for the previous port 0 patch, thanks to Pieter for noticing the error X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/a53b4c2409d4c2bff50060e893932b28f2f50f24 Fix for the previous port 0 patch, thanks to Pieter for noticing the error --- diff --git a/src/redis.c b/src/redis.c index e59f3a73..dacfcb56 100644 --- a/src/redis.c +++ b/src/redis.c @@ -865,12 +865,12 @@ void initServer() { server.el = aeCreateEventLoop(); server.db = zmalloc(sizeof(redisDb)*server.dbnum); - if (server.port != 0) + if (server.port != 0) { server.ipfd = anetTcpServer(server.neterr,server.port,server.bindaddr); - - if (server.ipfd == ANET_ERR) { - redisLog(REDIS_WARNING, "Opening port: %s", server.neterr); - exit(1); + if (server.ipfd == ANET_ERR) { + redisLog(REDIS_WARNING, "Opening port: %s", server.neterr); + exit(1); + } } if (server.unixsocket != NULL) { unlink(server.unixsocket); /* don't care if this fails */