diff options
author | Luca Boccassi <luca.boccassi@microsoft.com> | 2021-11-05 14:57:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-05 14:57:30 +0100 |
commit | 8389fd19d20370077f2d5601af0a089ec92ece05 (patch) | |
tree | 15402f17ca3b5fced203a7b8b3c79e8d6fe936e0 /src/portable | |
parent | meson-render-jinja2: use ast.literal_eval() (diff) | |
parent | Make pager_open() return void (diff) | |
download | systemd-8389fd19d20370077f2d5601af0a089ec92ece05.tar.xz systemd-8389fd19d20370077f2d5601af0a089ec92ece05.zip |
Merge pull request #20138 from keszybz/coding-style-variable-decls
A coding style tweak and checking of sd_notify() calls and voidification of pager_open()
Diffstat (limited to 'src/portable')
-rw-r--r-- | src/portable/portablectl.c | 4 | ||||
-rw-r--r-- | src/portable/portabled.c | 12 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/portable/portablectl.c b/src/portable/portablectl.c index e601ee5d8f..60feac6f5d 100644 --- a/src/portable/portablectl.c +++ b/src/portable/portablectl.c @@ -333,7 +333,7 @@ static int inspect_image(int argc, char *argv[], void *userdata) { if (r < 0) return bus_log_parse_error(r); - (void) pager_open(arg_pager_flags); + pager_open(arg_pager_flags); if (arg_cat) { printf("%s-- OS Release: --%s\n", ansi_highlight(), ansi_normal()); @@ -1093,7 +1093,7 @@ static int help(int argc, char *argv[], void *userdata) { _cleanup_free_ char *link = NULL; int r; - (void) pager_open(arg_pager_flags); + pager_open(arg_pager_flags); r = terminal_urlify_man("portablectl", "1", &link); if (r < 0) diff --git a/src/portable/portabled.c b/src/portable/portabled.c index 3c8e20e0f3..2f9afdc8f2 100644 --- a/src/portable/portabled.c +++ b/src/portable/portabled.c @@ -4,11 +4,11 @@ #include <sys/types.h> #include "sd-bus.h" -#include "sd-daemon.h" #include "alloc-util.h" #include "bus-log-control-api.h" #include "bus-polkit.h" +#include "daemon-util.h" #include "def.h" #include "main-func.h" #include "portabled-bus.h" @@ -154,15 +154,13 @@ static int run(int argc, char *argv[]) { return log_error_errno(r, "Failed to fully start up daemon: %m"); log_debug("systemd-portabled running as pid " PID_FMT, getpid_cached()); - sd_notify(false, - "READY=1\n" - "STATUS=Processing requests..."); + r = sd_notify(false, NOTIFY_READY); + if (r < 0) + log_warning_errno(r, "Failed to send readiness notification, ignoring: %m"); r = manager_run(m); - (void) sd_notify(false, - "STOPPING=1\n" - "STATUS=Shutting down..."); + (void) sd_notify(false, NOTIFY_STOPPING); log_debug("systemd-portabled stopped as pid " PID_FMT, getpid_cached()); return r; } |