summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-07-22 12:11:40 +0200
committerantirez <antirez@gmail.com>2011-07-22 12:12:55 +0200
commitec7bbadce925322f29346b692a0b5ac337560bba (patch)
treea46e3ad8ca216c741b8f98862db2e27c139f10c1
parent063923de1cd3deb4d18cb2fda9bafa7101ac92c2 (diff)
downloadredis-ec7bbadce925322f29346b692a0b5ac337560bba.tar.gz
Close the listening sockets. Apparently this allows faster restarts.
-rw-r--r--src/redis.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/redis.c b/src/redis.c
index 2d3f0403d..1d732e91f 100644
--- a/src/redis.c
+++ b/src/redis.c
@@ -1118,6 +1118,10 @@ int prepareForShutdown() {
redisLog(REDIS_NOTICE,"Removing the pid file.");
unlink(server.pidfile);
}
+ /* Close the listening sockets. Apparently this allows faster restarts. */
+ if (server.ipfd != -1) close(server.ipfd);
+ if (server.sofd != -1) close(server.sofd);
+
redisLog(REDIS_WARNING,"Redis is now ready to exit, bye bye...");
return REDIS_OK;
}