]> git.saurik.com Git - redis.git/commitdiff
Fix for 'CONFIG SET appendonly no'
authorantirez <antirez@gmail.com>
Wed, 19 May 2010 11:36:32 +0000 (13:36 +0200)
committerantirez <antirez@gmail.com>
Wed, 19 May 2010 11:36:32 +0000 (13:36 +0200)
redis.c

diff --git a/redis.c b/redis.c
index fed633cf0b8267929b626463e1114c72e89ff9b7..b95eb45566fcf898206bc23e7c9ca1a1027d1957 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -8738,11 +8738,12 @@ static void stopAppendOnly(void) {
     if (server.bgsavechildpid != -1) {
         int statloc;
 
-        kill(server.bgsavechildpid,SIGKILL);
-        wait3(&statloc,0,NULL);
+        if (kill(server.bgsavechildpid,SIGKILL) != -1)
+            wait3(&statloc,0,NULL);
         /* reset the buffer accumulating changes while the child saves */
         sdsfree(server.bgrewritebuf);
         server.bgrewritebuf = sdsempty();
+        server.bgsavechildpid = -1;
     }
 }