From 2316bb3b428d583b88a03ad45b955d618bd320cd Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 15 Jan 2010 13:17:43 -0500 Subject: [PATCH] minor fix --- redis.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/redis.c b/redis.c index fd912b494..343dce155 100644 --- a/redis.c +++ b/redis.c @@ -3011,7 +3011,12 @@ static int rdbSave(char *filename) { int j; time_t now = time(NULL); - waitEmptyIOJobsQueue(); /* Otherwise other threads may fseek() the swap */ + /* Wait for I/O therads to terminate, just in case this is a + * foreground-saving, to avoid seeking the swap file descriptor at the + * same time. */ + if (server.vm_enabled) + waitEmptyIOJobsQueue(); + snprintf(tmpfile,256,"temp-%d.rdb", (int) getpid()); fp = fopen(tmpfile,"w"); if (!fp) { -- GitLab