From 5d10923f7bc3333b5efaa151ea3b9a4e6ddfe72d Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 13 Oct 2010 17:17:56 +0200 Subject: [PATCH] Rename variable sockpath to unixsocket --- redis.conf | 7 ++++--- src/config.c | 4 ++-- src/redis.c | 10 +++++----- src/redis.h | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/redis.conf b/redis.conf index 75420f649..a01bdd156 100644 --- a/redis.conf +++ b/redis.conf @@ -29,10 +29,11 @@ port 6379 # # bind 127.0.0.1 -# Specify the path for the domain socket that will be used to listen for -# incoming connections. If not specified, Redis will not use a domain socket. +# Specify the path for the unix socket that will be used to listen for +# incoming connections. There is no default, so Redis will not listen +# on a unix socket when not specified. # -# socket /tmp/redis.sock +# unixsocket /tmp/redis.sock # Close the connection after a client is idle for N seconds (0 to disable) timeout 300 diff --git a/src/config.c b/src/config.c index b11bbd0f5..6b281a142 100644 --- a/src/config.c +++ b/src/config.c @@ -73,8 +73,8 @@ void loadServerConfig(char *filename) { } } else if (!strcasecmp(argv[0],"bind") && argc == 2) { server.bindaddr = zstrdup(argv[1]); - } else if (!strcasecmp(argv[0],"socket") && argc == 2) { - server.sockpath = zstrdup(argv[1]); + } else if (!strcasecmp(argv[0],"unixsocket") && argc == 2) { + server.unixsocket = zstrdup(argv[1]); } else if (!strcasecmp(argv[0],"save") && argc == 3) { int seconds = atoi(argv[1]); int changes = atoi(argv[2]); diff --git a/src/redis.c b/src/redis.c index 65675cdf3..0c3d0ce92 100644 --- a/src/redis.c +++ b/src/redis.c @@ -698,7 +698,7 @@ void createSharedObjects(void) { void initServerConfig() { server.port = REDIS_SERVERPORT; server.bindaddr = NULL; - server.sockpath = NULL; + server.unixsocket = NULL; server.ipfd = -1; server.sofd = -1; server.dbnum = REDIS_DEFAULT_DBNUM; @@ -783,9 +783,9 @@ void initServer() { exit(1); } } - if (server.sockpath != NULL) { - unlink(server.sockpath); /* don't care if this fails */ - server.sofd = anetUnixServer(server.neterr,server.sockpath); + if (server.unixsocket != NULL) { + unlink(server.unixsocket); /* don't care if this fails */ + server.sofd = anetUnixServer(server.neterr,server.unixsocket); if (server.sofd == ANET_ERR) { redisLog(REDIS_WARNING, "Opening socket: %s", server.neterr); exit(1); @@ -1438,7 +1438,7 @@ int main(int argc, char **argv) { if (server.ipfd > 0) redisLog(REDIS_NOTICE,"The server is now ready to accept connections on port %d", server.port); if (server.sofd > 0) - redisLog(REDIS_NOTICE,"The server is now ready to accept connections at %s", server.sockpath); + redisLog(REDIS_NOTICE,"The server is now ready to accept connections at %s", server.unixsocket); aeSetBeforeSleepProc(server.el,beforeSleep); aeMain(server.el); aeDeleteEventLoop(server.el); diff --git a/src/redis.h b/src/redis.h index 079a67ba7..bfdde1a05 100644 --- a/src/redis.h +++ b/src/redis.h @@ -330,7 +330,7 @@ struct redisServer { pthread_t mainthread; int port; char *bindaddr; - char *sockpath; + char *unixsocket; int ipfd; int sofd; redisDb *db;