summaryrefslogtreecommitdiff
path: root/src/core/job.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-04-20 14:15:28 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-04-21 13:37:04 -0400
commitba360bb05ce9b0bb86821fcdfebf66ccd9f7efd5 (patch)
tree1eea995131e7f602d4d800330ffdafb5ec8b3171 /src/core/job.c
parentc8304ba9027aa2bbca3aa9dfe9fcc951c16932e6 (diff)
tree-wide: mark log_struct with _printf_ and fix fallout
log_struct takes multiple format strings, each one followed by arguments. The _printf_ annotation is not sufficiently flexible to express this, but we can still annotate the first format string, though not its arguments (because their number is unknown). With the annotation, the places which specified the message id or similar as the first pattern cause a warning from -Wformat-nonliteral. This can be trivially fixed by putting the MESSAGE= first. This change will help find issues where a non-literal is erroneously used as the pattern.
Diffstat (limited to 'src/core/job.c')
-rw-r--r--src/core/job.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/job.c b/src/core/job.c
index e2349830a8..a02f1bb2bc 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -800,18 +800,18 @@ static void job_log_status_message(Unit *u, JobType t, JobResult result) {
default:
log_struct(job_result_log_level[result],
- LOG_UNIT_ID(u),
LOG_MESSAGE("%s", buf),
"RESULT=%s", job_result_to_string(result),
+ LOG_UNIT_ID(u),
NULL);
return;
}
log_struct(job_result_log_level[result],
- mid,
- LOG_UNIT_ID(u),
LOG_MESSAGE("%s", buf),
"RESULT=%s", job_result_to_string(result),
+ LOG_UNIT_ID(u),
+ mid,
NULL);
}