Commit 5d10923f authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

Rename variable sockpath to unixsocket

parent 704bd093
...@@ -29,10 +29,11 @@ port 6379 ...@@ -29,10 +29,11 @@ port 6379
# #
# bind 127.0.0.1 # bind 127.0.0.1
# Specify the path for the domain socket that will be used to listen for # Specify the path for the unix socket that will be used to listen for
# incoming connections. If not specified, Redis will not use a domain socket. # 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) # Close the connection after a client is idle for N seconds (0 to disable)
timeout 300 timeout 300
......
...@@ -73,8 +73,8 @@ void loadServerConfig(char *filename) { ...@@ -73,8 +73,8 @@ void loadServerConfig(char *filename) {
} }
} else if (!strcasecmp(argv[0],"bind") && argc == 2) { } else if (!strcasecmp(argv[0],"bind") && argc == 2) {
server.bindaddr = zstrdup(argv[1]); server.bindaddr = zstrdup(argv[1]);
} else if (!strcasecmp(argv[0],"socket") && argc == 2) { } else if (!strcasecmp(argv[0],"unixsocket") && argc == 2) {
server.sockpath = zstrdup(argv[1]); server.unixsocket = zstrdup(argv[1]);
} else if (!strcasecmp(argv[0],"save") && argc == 3) { } else if (!strcasecmp(argv[0],"save") && argc == 3) {
int seconds = atoi(argv[1]); int seconds = atoi(argv[1]);
int changes = atoi(argv[2]); int changes = atoi(argv[2]);
......
...@@ -698,7 +698,7 @@ void createSharedObjects(void) { ...@@ -698,7 +698,7 @@ void createSharedObjects(void) {
void initServerConfig() { void initServerConfig() {
server.port = REDIS_SERVERPORT; server.port = REDIS_SERVERPORT;
server.bindaddr = NULL; server.bindaddr = NULL;
server.sockpath = NULL; server.unixsocket = NULL;
server.ipfd = -1; server.ipfd = -1;
server.sofd = -1; server.sofd = -1;
server.dbnum = REDIS_DEFAULT_DBNUM; server.dbnum = REDIS_DEFAULT_DBNUM;
...@@ -783,9 +783,9 @@ void initServer() { ...@@ -783,9 +783,9 @@ void initServer() {
exit(1); exit(1);
} }
} }
if (server.sockpath != NULL) { if (server.unixsocket != NULL) {
unlink(server.sockpath); /* don't care if this fails */ unlink(server.unixsocket); /* don't care if this fails */
server.sofd = anetUnixServer(server.neterr,server.sockpath); server.sofd = anetUnixServer(server.neterr,server.unixsocket);
if (server.sofd == ANET_ERR) { if (server.sofd == ANET_ERR) {
redisLog(REDIS_WARNING, "Opening socket: %s", server.neterr); redisLog(REDIS_WARNING, "Opening socket: %s", server.neterr);
exit(1); exit(1);
...@@ -1438,7 +1438,7 @@ int main(int argc, char **argv) { ...@@ -1438,7 +1438,7 @@ int main(int argc, char **argv) {
if (server.ipfd > 0) if (server.ipfd > 0)
redisLog(REDIS_NOTICE,"The server is now ready to accept connections on port %d", server.port); redisLog(REDIS_NOTICE,"The server is now ready to accept connections on port %d", server.port);
if (server.sofd > 0) 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); aeSetBeforeSleepProc(server.el,beforeSleep);
aeMain(server.el); aeMain(server.el);
aeDeleteEventLoop(server.el); aeDeleteEventLoop(server.el);
......
...@@ -330,7 +330,7 @@ struct redisServer { ...@@ -330,7 +330,7 @@ struct redisServer {
pthread_t mainthread; pthread_t mainthread;
int port; int port;
char *bindaddr; char *bindaddr;
char *sockpath; char *unixsocket;
int ipfd; int ipfd;
int sofd; int sofd;
redisDb *db; redisDb *db;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment