]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
login: use FOREACH_STRING() at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 13 May 2025 15:21:41 +0000 (00:21 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 13 May 2025 17:06:02 +0000 (02:06 +0900)
src/login/logind.c

index 877f30f9376ef0172c86c0ce7a573d018216199f..31565f1fce3ed66c62288372a07be904e84d30e4 100644 (file)
@@ -889,17 +889,11 @@ static int manager_connect_udev(Manager *m) {
         if (r < 0)
                 return r;
 
-        r = sd_device_monitor_filter_add_match_subsystem_devtype(m->device_monitor, "input", NULL);
-        if (r < 0)
-                return r;
-
-        r = sd_device_monitor_filter_add_match_subsystem_devtype(m->device_monitor, "graphics", NULL);
-        if (r < 0)
-                return r;
-
-        r = sd_device_monitor_filter_add_match_subsystem_devtype(m->device_monitor, "drm", NULL);
-        if (r < 0)
-                return r;
+        FOREACH_STRING(s, "input", "graphics", "drm") {
+                r = sd_device_monitor_filter_add_match_subsystem_devtype(m->device_monitor, s, /* devtype = */ NULL);
+                if (r < 0)
+                        return r;
+        }
 
         r = sd_device_monitor_attach_event(m->device_monitor, m->event);
         if (r < 0)