diff options
author | David Tardon <dtardon@redhat.com> | 2022-08-09 14:35:15 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2022-09-13 08:13:27 +0200 |
commit | 995340074e554b4bf4a0fdb0cb7436692c5a4ffd (patch) | |
tree | ca3ee001db3e608ee80478f42fea9c3b409f1b7b /src/locale/localectl.c | |
parent | Merge pull request #23087 from yuwata/udev-watch (diff) | |
download | systemd-995340074e554b4bf4a0fdb0cb7436692c5a4ffd.tar.xz systemd-995340074e554b4bf4a0fdb0cb7436692c5a4ffd.zip |
tree-wide: use ASSERT_PTR more
Diffstat (limited to 'src/locale/localectl.c')
-rw-r--r-- | src/locale/localectl.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/locale/localectl.c b/src/locale/localectl.c index 55db3c9ed8..ebbf107432 100644 --- a/src/locale/localectl.c +++ b/src/locale/localectl.c @@ -164,11 +164,9 @@ static int show_status(int argc, char **argv, void *userdata) { _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL; - sd_bus *bus = userdata; + sd_bus *bus = ASSERT_PTR(userdata); int r; - assert(bus); - r = bus_map_all_properties(bus, "org.freedesktop.locale1", "/org/freedesktop/locale1", @@ -186,11 +184,9 @@ static int show_status(int argc, char **argv, void *userdata) { static int set_locale(int argc, char **argv, void *userdata) { _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL; _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; - sd_bus *bus = userdata; + sd_bus *bus = ASSERT_PTR(userdata); int r; - assert(bus); - polkit_agent_open_if_enabled(arg_transport, arg_ask_password); r = bus_message_new_method_call(bus, &m, bus_locale, "SetLocale"); @@ -230,11 +226,9 @@ static int list_locales(int argc, char **argv, void *userdata) { static int set_vconsole_keymap(int argc, char **argv, void *userdata) { _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; const char *map, *toggle_map; - sd_bus *bus = userdata; + sd_bus *bus = ASSERT_PTR(userdata); int r; - assert(bus); - polkit_agent_open_if_enabled(arg_transport, arg_ask_password); map = argv[1]; |