diff options
author | Djalal Harouni <tixxdz@opendz.org> | 2017-04-23 01:03:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-23 01:03:42 +0200 |
commit | 74e941c0226a04e2c6b80dd149d0f55e518481ed (patch) | |
tree | cffadb1c7096b0209e01fa676e74ad301b1985c7 /src/core | |
parent | 56744c037da0ba2032fba0c7ac116317bb5ae4ae (diff) | |
parent | ae2173d66b8b9fc42f311d8586a3cf4abcc65a76 (diff) |
Merge pull request #5774 from keszybz/printf-annotations
Printf annotation improvements
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/execute.c | 4 | ||||
-rw-r--r-- | src/core/job.c | 6 | ||||
-rw-r--r-- | src/core/selinux-access.c | 7 | ||||
-rw-r--r-- | src/core/service.c | 2 | ||||
-rw-r--r-- | src/core/unit.c | 4 |
5 files changed, 14 insertions, 9 deletions
diff --git a/src/core/execute.c b/src/core/execute.c index 6e7c76e4ff..2056e2273c 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -2887,9 +2887,9 @@ static int exec_child( if (line) { log_open(); log_struct(LOG_DEBUG, - LOG_UNIT_ID(unit), "EXECUTABLE=%s", command->path, LOG_UNIT_MESSAGE(unit, "Executing: %s", line), + LOG_UNIT_ID(unit), NULL); log_close(); } @@ -2953,9 +2953,9 @@ int exec_spawn(Unit *unit, return log_oom(); log_struct(LOG_DEBUG, - LOG_UNIT_ID(unit), LOG_UNIT_MESSAGE(unit, "About to execute: %s", line), "EXECUTABLE=%s", command->path, + LOG_UNIT_ID(unit), NULL); pid = fork(); if (pid < 0) 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); } diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c index 2b96a9551b..0f8a2d68e2 100644 --- a/src/core/selinux-access.c +++ b/src/core/selinux-access.c @@ -135,7 +135,12 @@ _printf_(2, 3) static int log_callback(int type, const char *fmt, ...) { fmt2 = strjoina("selinux: ", fmt); va_start(ap, fmt); - log_internalv(LOG_AUTH | callback_type_to_priority(type), 0, __FILE__, __LINE__, __FUNCTION__, fmt2, ap); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" + log_internalv(LOG_AUTH | callback_type_to_priority(type), + 0, __FILE__, __LINE__, __FUNCTION__, + fmt2, ap); +#pragma GCC diagnostic pop va_end(ap); return 0; diff --git a/src/core/service.c b/src/core/service.c index 74054887b9..185173a542 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -2693,7 +2693,6 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { log_struct(f == SERVICE_SUCCESS ? LOG_DEBUG : (code == CLD_EXITED ? LOG_NOTICE : LOG_WARNING), - LOG_UNIT_ID(u), LOG_UNIT_MESSAGE(u, "Main process exited, code=%s, status=%i/%s", sigchld_code_to_string(code), status, strna(code == CLD_EXITED @@ -2701,6 +2700,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { : signal_to_string(status))), "EXIT_CODE=%s", sigchld_code_to_string(code), "EXIT_STATUS=%i", status, + LOG_UNIT_ID(u), NULL); if (s->result == SERVICE_SUCCESS) diff --git a/src/core/unit.c b/src/core/unit.c index f76b6c30a8..25ea5a8591 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -1497,9 +1497,9 @@ static void unit_status_log_starting_stopping_reloading(Unit *u, JobType t) { * possible, which means we should avoid the low-level unit * name. */ log_struct(LOG_INFO, - mid, - LOG_UNIT_ID(u), LOG_MESSAGE("%s", buf), + LOG_UNIT_ID(u), + mid, NULL); } |