unit: Add LOG_CONTEXT_PUSH_UNIT()

A helper macro to push all unit related fields onto the log context.
We also modify exec_spawn() to use it.
This commit is contained in:
Daan De Meyer
2023-03-21 14:59:16 +01:00
parent 81b3565efd
commit 4b2af439eb
2 changed files with 12 additions and 0 deletions
+2
View File
@@ -5474,6 +5474,8 @@ int exec_spawn(Unit *unit,
assert(params);
assert(params->fds || (params->n_socket_fds + params->n_storage_fds <= 0));
LOG_CONTEXT_PUSH_UNIT(unit);
if (context->std_input == EXEC_INPUT_SOCKET ||
context->std_output == EXEC_OUTPUT_SOCKET ||
context->std_error == EXEC_OUTPUT_SOCKET) {