tree-wide: check more log message format in log_struct() and friends
This introduce LOG_ITEM() macro that checks arbitrary formats in log_struct(). Then, drop _printf_ attribute from log_struct_internal(), as it does not help so much, and compiler checked only the first format string. Hopefully, this silences false-positive warnings by Coverity.
This commit is contained in:
+1
-1
@@ -463,7 +463,7 @@ static void log_command_line(Unit *unit, const char *msg, const char *executable
|
||||
_cleanup_free_ char *cmdline = quote_command_line(argv, SHELL_ESCAPE_EMPTY);
|
||||
|
||||
log_unit_struct(unit, LOG_DEBUG,
|
||||
"EXECUTABLE=%s", executable,
|
||||
LOG_ITEM("EXECUTABLE=%s", executable),
|
||||
LOG_UNIT_MESSAGE(unit, "%s: %s", msg, strnull(cmdline)),
|
||||
LOG_UNIT_INVOCATION_ID(unit));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user