]> git.saurik.com Git - redis.git/blobdiff - src/redis.c
Fix adding bulk reply when getcwd fails
[redis.git] / src / redis.c
index 4e2f73a71821f3c0914b9830d84dbf85517eafa6..0bedc25b38c8c6250f882e0fa07e08b9986548a7 100644 (file)
@@ -1190,6 +1190,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;
 }