Permalink
Browse files

Rename variable sockpath to unixsocket

  • Loading branch information...
1 parent 704bd09 commit 5d10923f7bc3333b5efaa151ea3b9a4e6ddfe72d @pietern pietern committed Oct 13, 2010
Showing with 12 additions and 11 deletions.
  1. +4 −3 redis.conf
  2. +2 −2 src/config.c
  3. +5 −5 src/redis.c
  4. +1 −1 src/redis.h
View
@@ -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
View
@@ -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]);
View
@@ -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);
View
@@ -330,7 +330,7 @@ struct redisServer {
pthread_t mainthread;
int port;
char *bindaddr;
- char *sockpath;
+ char *unixsocket;
int ipfd;
int sofd;
redisDb *db;

0 comments on commit 5d10923

Please sign in to comment.