X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/48553a29e8c56fcc21f77b284a4d3a3448a75e1e..4b1f6ad3e7a5c7c28618e43e7539c9a937bf8521:/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); }