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:
+2
-2
@@ -252,10 +252,10 @@ static int run(int argc, char *argv[]) {
|
||||
exit_status_to_string(exit_status, EXIT_STATUS_LIBC | EXIT_STATUS_SYSTEMD));
|
||||
|
||||
log_exec_struct_errno(&context, ¶ms, LOG_ERR, r,
|
||||
"MESSAGE_ID=" SD_MESSAGE_SPAWN_FAILED_STR,
|
||||
LOG_MESSAGE_ID(SD_MESSAGE_SPAWN_FAILED_STR),
|
||||
LOG_EXEC_MESSAGE(¶ms, "Failed at step %s spawning %s: %m",
|
||||
status, command.path),
|
||||
"EXECUTABLE=%s", command.path);
|
||||
LOG_ITEM("EXECUTABLE=%s", command.path));
|
||||
} else
|
||||
/* r == 0: 'skip' is chosen in the confirm spawn prompt
|
||||
* r > 0: expected/ignored failure, do not log at error level */
|
||||
|
||||
Reference in New Issue
Block a user