diff options
author | Thomas Haller <thaller@redhat.com> | 2022-02-01 23:00:58 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2022-02-08 18:58:54 +0100 |
commit | aa15ec6090706cfe9a3de905131f56a6cbc5f443 (patch) | |
tree | 0c2b47eb56147dee0ed19b2fb9ccc18d47cfc2b2 | |
parent | e3e17f0b4b8691c5a9aa3c63eb23e9e6531827c0 (diff) | |
download | NetworkManager-aa15ec6090706cfe9a3de905131f56a6cbc5f443.tar.gz |
core/rfkill: use nm_streq() in "nm-rfkill-manager.c"
-rw-r--r-- | src/core/nm-rfkill-manager.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/nm-rfkill-manager.c b/src/core/nm-rfkill-manager.c index 2106128c6c..87646227f2 100644 --- a/src/core/nm-rfkill-manager.c +++ b/src/core/nm-rfkill-manager.c @@ -305,6 +305,7 @@ rfkill_add(NMRfkillManager *self, struct udev_device *device) g_return_if_fail(device != NULL); name = udev_device_get_sysname(device); + g_return_if_fail(name != NULL); if (!killswitch_find_by_name(self, name)) @@ -346,16 +347,16 @@ handle_uevent(NMUdevClient *client, struct udev_device *device, gpointer user_da /* A bit paranoid */ subsys = udev_device_get_subsystem(device); - g_return_if_fail(!g_strcmp0(subsys, "rfkill")); + g_return_if_fail(nm_streq0(subsys, "rfkill")); nm_log_dbg(LOGD_PLATFORM, "udev rfkill event: action '%s' device '%s'", action, udev_device_get_sysname(device)); - if (!strcmp(action, "add")) + if (nm_streq(action, "add")) rfkill_add(self, device); - else if (!strcmp(action, "remove")) + else if (nm_streq(action, "remove")) rfkill_remove(self, device); recheck_killswitches(self); |