static int journal_put_error(sd_journal *j, int r, const char *path) {
_cleanup_free_ char *copy = NULL;
- int k;
/* Memorize an error we encountered, and store which
* file/directory it was generated from. Note that we store
return -ENOMEM;
}
- k = hashmap_ensure_put(&j->errors, NULL, INT_TO_PTR(r), copy);
- if (k < 0) {
- if (k == -EEXIST)
- return 0;
-
- return k;
- }
+ r = hashmap_ensure_put(&j->errors, NULL, INT_TO_PTR(r), copy);
+ if (r == -EEXIST)
+ return 0;
+ if (r < 0)
+ return r;
TAKE_PTR(copy);
return 0;
bool found;
if (j->current_location.type == LOCATION_DISCRETE) {
- int k;
-
- k = compare_with_location(j, f, &j->current_location, j->current_file);
-
- found = direction == DIRECTION_DOWN ? k > 0 : k < 0;
+ r = compare_with_location(j, f, &j->current_location, j->current_file);
+ found = direction == DIRECTION_DOWN ? r > 0 : r < 0;
} else
found = true;
if (!new_file)
found = true;
else {
- int k;
-
- k = compare_locations(j, f, new_file);
-
- found = direction == DIRECTION_DOWN ? k < 0 : k > 0;
+ r = compare_locations(j, f, new_file);
+ found = direction == DIRECTION_DOWN ? r < 0 : r > 0;
}
if (found)
_cleanup_free_ char *item = NULL;
unsigned long long ll;
sd_id128_t id;
- int k = 0;
r = extract_first_word(&cursor, &item, ";", EXTRACT_DONT_COALESCE_SEPARATORS);
if (r < 0)
switch (item[0]) {
case 's':
- k = sd_id128_from_string(item+2, &id);
- if (k < 0)
- return k;
+ r = sd_id128_from_string(item+2, &id);
+ if (r < 0)
+ return r;
if (!sd_id128_equal(id, j->current_file->header->seqnum_id))
return 0;
break;
break;
case 'b':
- k = sd_id128_from_string(item+2, &id);
- if (k < 0)
- return k;
+ r = sd_id128_from_string(item+2, &id);
+ if (r < 0)
+ return r;
if (!sd_id128_equal(id, o->entry.boot_id))
return 0;
break;