X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fsd-journal.c;fp=src%2Fjournal%2Fsd-journal.c;h=89cab3733128d351901690b2a9d8c45f71dabcbb;hb=b29ddfcb389127cf00ab41447a721e479fe15713;hp=173f9484e75a854a9e0b0e54c0e2f0a612ed1f2d;hpb=487d37209b30a536636c95479cfeba931fea25c5;p=elogind.git diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c index 173f9484e..89cab3733 100644 --- a/src/journal/sd-journal.c +++ b/src/journal/sd-journal.c @@ -697,23 +697,22 @@ static int next_with_matches( Object **ret, uint64_t *offset) { - uint64_t cp; - assert(j); assert(f); assert(ret); assert(offset); - cp = *offset; - /* No matches is easy. We simple advance the file * pointer by one. */ if (!j->level0) - return journal_file_next_entry(f, cp, direction, ret, offset); + return journal_file_next_entry(f, f->current_offset, direction, ret, offset); /* If we have a match then we look for the next matching entry * with an offset at least one step larger */ - return next_for_match(j, j->level0, f, direction == DIRECTION_DOWN ? cp+1 : cp-1, direction, ret, offset); + return next_for_match(j, j->level0, f, + direction == DIRECTION_DOWN ? f->current_offset + 1 + : f->current_offset - 1, + direction, ret, offset); } static int next_beyond_location(sd_journal *j, JournalFile *f, direction_t direction) { @@ -731,8 +730,6 @@ static int next_beyond_location(sd_journal *j, JournalFile *f, direction_t direc f->last_n_entries = n_entries; if (f->last_direction == direction && f->current_offset > 0) { - cp = f->current_offset; - /* LOCATION_SEEK here means we did the work in a previous * iteration and the current location already points to a * candidate entry. */