X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/f00b0844c9d825bd19597e214ef8169333684810..a6305f13d568858bf7a9246e4e457a3a90cd7837:/src/aof.c diff --git a/src/aof.c b/src/aof.c index 1df60b94..441ccaf1 100644 --- a/src/aof.c +++ b/src/aof.c @@ -250,6 +250,13 @@ void flushAppendOnlyFile(int force) { strerror(errno), (long)nwritten, (long)sdslen(server.aof_buf)); + + if (ftruncate(server.aof_fd, server.aof_current_size) == -1) { + redisLog(REDIS_WARNING, "Could not remove short write " + "from the append-only file. Redis may refuse " + "to load the AOF the next time it starts. " + "ftruncate: %s", strerror(errno)); + } } exit(1); }