Skip to content

Commit

Permalink
coredump: actually store parsed unit in the context
Browse files Browse the repository at this point in the history
RHEL-only

Related: RHEL-18302
  • Loading branch information
msekletar authored and github-actions[bot] committed Mar 6, 2024
1 parent ca150b9 commit ccaa361
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/coredump/coredump.c
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,8 @@ static int gather_pid_metadata(
context->meta[CONTEXT_EXE] = t;

if (cg_pid_get_unit(pid, &t) >= 0) {
context->meta[CONTEXT_UNIT] = t;

if (!is_journald_crash(context)) {
/* OK, now we know it's not the journal, hence we can make use of it now. */
log_set_target(LOG_TARGET_JOURNAL_OR_KMSG);
Expand All @@ -1275,8 +1277,7 @@ static int gather_pid_metadata(
}

set_iovec_string_field(iovec, n_iovec, "COREDUMP_UNIT=", context->meta[CONTEXT_UNIT]);
} else
context->meta[CONTEXT_UNIT] = t;
}

if (cg_pid_get_user_unit(pid, &t) >= 0)
set_iovec_field_free(iovec, n_iovec, "COREDUMP_USER_UNIT=", t);
Expand Down

0 comments on commit ccaa361

Please sign in to comment.