]> git.saurik.com Git - redis.git/blobdiff - src/aof.c
Import linenoise as dependency for redis-cli
[redis.git] / src / aof.c
index 4dbce394c821930cab09da3a79ed0b8c26187626..2396ba2c553183f6baaf7837c60e9aac8d971459 100644 (file)
--- a/src/aof.c
+++ b/src/aof.c
@@ -549,7 +549,8 @@ int rewriteAppendOnlyFileBackground(void) {
         char tmpfile[256];
 
         if (server.vm_enabled) vmReopenSwapFile();
-        close(server.fd);
+        if (server.ipfd > 0) close(server.ipfd);
+        if (server.sofd > 0) close(server.sofd);
         snprintf(tmpfile,256,"temp-rewriteaof-bg-%d.aof", (int) getpid());
         if (rewriteAppendOnlyFile(tmpfile) == REDIS_OK) {
             _exit(0);