]> git.saurik.com Git - redis.git/commitdiff
Fixed a subtle VM bug... was not flushing the buffer so the child process read trunca...
authorantirez <antirez@gmail.com>
Mon, 1 Mar 2010 23:52:50 +0000 (00:52 +0100)
committerantirez <antirez@gmail.com>
Mon, 1 Mar 2010 23:52:50 +0000 (00:52 +0100)
redis.c

diff --git a/redis.c b/redis.c
index c10fb03af95b2ad483c395baecbd19c54eba1667..8273cd1299f7d47499c755dfe1ef88b1e5c72bf6 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -7416,6 +7416,7 @@ static int vmWriteObjectOnSwap(robj *o, off_t page) {
         return REDIS_ERR;
     }
     rdbSaveObject(server.vm_fp,o);
+    fflush(server.vm_fp);
     if (server.vm_enabled) pthread_mutex_unlock(&server.io_swapfile_mutex);
     return REDIS_OK;
 }
@@ -7443,7 +7444,6 @@ static int vmSwapObjectBlocking(robj *key, robj *val) {
         (unsigned long long) page, (unsigned long long) pages);
     server.vm_stats_swapped_objects++;
     server.vm_stats_swapouts++;
-    fflush(server.vm_fp);
     return REDIS_OK;
 }