diff options
author | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2022-09-14 19:24:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-14 19:24:32 +0300 |
commit | b629d3e31017601e06edc6d5b2be4edf8650ab71 (patch) | |
tree | 07ab10f4f9745896b6bfb2e71e92eafe62c7e8c6 /database/engine/journalfile.c | |
parent | 466b1fcc56d3dc4787f332d76db0623f5dad9f91 (diff) |
Advance the buffer properly to scan the journal file (#13666)
Diffstat (limited to 'database/engine/journalfile.c')
-rw-r--r-- | database/engine/journalfile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/database/engine/journalfile.c b/database/engine/journalfile.c index e15c57eb30..50625d1e01 100644 --- a/database/engine/journalfile.c +++ b/database/engine/journalfile.c @@ -442,7 +442,7 @@ static uint64_t iterate_transactions(struct rrdengine_instance *ctx, struct rrde //data_file_size = journalfile->datafile->pos; TODO: utilize this? max_id = 1; - bool journal_is_mmapped = journalfile->data; + bool journal_is_mmapped = (journalfile->data != NULL); if (unlikely(!journal_is_mmapped)) { ret = posix_memalign((void *)&buf, RRDFILE_ALIGNMENT, READAHEAD_BYTES); if (unlikely(ret)) @@ -479,7 +479,7 @@ static uint64_t iterate_transactions(struct rrdengine_instance *ctx, struct rrde max_id = MAX(max_id, id); } if (likely(journal_is_mmapped)) - buf = journalfile->data + size_bytes; + buf += size_bytes; } skip_file: if (unlikely(!journal_is_mmapped)) |