mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
journal: Only move to object if requested
This commit is contained in:
parent
47a9f91760
commit
4d8b09e4b8
@ -493,7 +493,6 @@ static int next_for_match(
|
||||
|
||||
int r;
|
||||
uint64_t np = 0;
|
||||
Object *n;
|
||||
|
||||
assert(j);
|
||||
assert(m);
|
||||
@ -569,12 +568,12 @@ static int next_for_match(
|
||||
|
||||
assert(np > 0);
|
||||
|
||||
r = journal_file_move_to_object(f, OBJECT_ENTRY, np, &n);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (ret) {
|
||||
r = journal_file_move_to_object(f, OBJECT_ENTRY, np, ret);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (ret)
|
||||
*ret = n;
|
||||
if (offset)
|
||||
*offset = np;
|
||||
|
||||
@ -633,7 +632,6 @@ static int find_location_for_match(
|
||||
|
||||
} else if (m->type == MATCH_OR_TERM) {
|
||||
uint64_t np = 0;
|
||||
Object *n;
|
||||
|
||||
/* Find the earliest match */
|
||||
|
||||
@ -652,12 +650,12 @@ static int find_location_for_match(
|
||||
if (np == 0)
|
||||
return 0;
|
||||
|
||||
r = journal_file_move_to_object(f, OBJECT_ENTRY, np, &n);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (ret) {
|
||||
r = journal_file_move_to_object(f, OBJECT_ENTRY, np, ret);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (ret)
|
||||
*ret = n;
|
||||
if (offset)
|
||||
*offset = np;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user