journal: return 0 from _skip() when it didn't skip
Seeking to the tail and calling `sd_journal_previous_skip(journal, 0)` was equivalent to calling it with skip == 1 (same for head and next()).
This commit is contained in:
@@ -882,8 +882,11 @@ static int real_journal_next_skip(sd_journal *j, direction_t direction, uint64_t
|
||||
if (skip == 0) {
|
||||
/* If this is not a discrete skip, then at least
|
||||
* resolve the current location */
|
||||
if (j->current_location.type != LOCATION_DISCRETE)
|
||||
return real_journal_next(j, direction);
|
||||
if (j->current_location.type != LOCATION_DISCRETE) {
|
||||
r = real_journal_next(j, direction);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user