From: Lennart Poettering Date: Thu, 9 Jan 2020 16:03:57 +0000 (+0100) Subject: core: use unit-based logging instead of generic logging where appropriate X-Git-Tag: v245-rc1~149^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=af4454cb17da6727e490522afb7d4bddf8dae7fd;p=thirdparty%2Fsystemd.git core: use unit-based logging instead of generic logging where appropriate --- diff --git a/src/core/swap.c b/src/core/swap.c index 6caf20ea664..d4f6db6ddce 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -768,9 +768,9 @@ static void swap_enter_activating(Swap *s) { r = fstab_find_pri(s->parameters_fragment.options, &priority); if (r < 0) - log_warning_errno(r, "Failed to parse swap priority \"%s\", ignoring: %m", s->parameters_fragment.options); - else if (r == 1 && s->parameters_fragment.priority_set) - log_warning("Duplicate swap priority configuration by Priority and Options fields."); + log_unit_warning_errno(UNIT(s), r, "Failed to parse swap priority \"%s\", ignoring: %m", s->parameters_fragment.options); + else if (r > 0 && s->parameters_fragment.priority_set) + log_unit_warning(UNIT(s), "Duplicate swap priority configuration by Priority= and Options= fields."); if (r <= 0 && s->parameters_fragment.priority_set) { if (s->parameters_fragment.options) @@ -788,7 +788,7 @@ static void swap_enter_activating(Swap *s) { if (s->parameters_fragment.options || opts) { r = exec_command_append(s->control_command, "-o", - opts ? : s->parameters_fragment.options, NULL); + opts ?: s->parameters_fragment.options, NULL); if (r < 0) goto fail; } @@ -804,7 +804,6 @@ static void swap_enter_activating(Swap *s) { goto fail; swap_set_state(s, SWAP_ACTIVATING); - return; fail: