X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/16d778780eb865deefb2bfa024aef50926917eac..9ad853ccde374ed371efee3b1654c6ebb39e06fa:/src/aof.c diff --git a/src/aof.c b/src/aof.c index f5d04a62..56392f2a 100644 --- a/src/aof.c +++ b/src/aof.c @@ -529,7 +529,10 @@ int rewriteAppendOnlyFileBackground(void) { pid_t childpid; if (server.bgrewritechildpid != -1) return REDIS_ERR; - redisAssert(server.ds_enabled == 0); + if (server.ds_enabled != 0) { + redisLog(REDIS_WARNING,"BGREWRITEAOF called with diskstore enabled: AOF is not supported when diskstore is enabled. Operation not performed."); + return REDIS_ERR; + } if ((childpid = fork()) == 0) { /* Child */ char tmpfile[256]; @@ -585,10 +588,7 @@ void aofRemoveTempFile(pid_t childpid) { /* A background append only file rewriting (BGREWRITEAOF) terminated its work. * Handle this. */ -void backgroundRewriteDoneHandler(int statloc) { - int exitcode = WEXITSTATUS(statloc); - int bysignal = WIFSIGNALED(statloc); - +void backgroundRewriteDoneHandler(int exitcode, int bysignal) { if (!bysignal && exitcode == 0) { int fd; char tmpfile[256]; @@ -636,7 +636,7 @@ void backgroundRewriteDoneHandler(int statloc) { } else { redisLog(REDIS_WARNING, "Background append only file rewriting terminated by signal %d", - WTERMSIG(statloc)); + bysignal); } cleanup: sdsfree(server.bgrewritebuf);