From: Yu Watanabe Date: Fri, 2 Sep 2022 17:09:06 +0000 (+0900) Subject: udevadm-wait: shorten code a bit X-Git-Tag: v252-rc1~247^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F24520%2Fhead;p=thirdparty%2Fsystemd.git udevadm-wait: shorten code a bit --- diff --git a/src/udev/udevadm-wait.c b/src/udev/udevadm-wait.c index 53fdacb867d..544c94616d5 100644 --- a/src/udev/udevadm-wait.c +++ b/src/udev/udevadm-wait.c @@ -166,16 +166,9 @@ static int device_monitor_handler(sd_device_monitor *monitor, sd_device *device, if (path_strv_contains(arg_devices, name)) return check_and_exit(sd_device_monitor_get_event(monitor)); - STRV_FOREACH(p, arg_devices) { - const char *link; - - if (!path_startswith(*p, "/dev")) - continue; - - FOREACH_DEVICE_DEVLINK(device, link) - if (path_equal(*p, link)) - return check_and_exit(sd_device_monitor_get_event(monitor)); - } + FOREACH_DEVICE_DEVLINK(device, name) + if (path_strv_contains(arg_devices, name)) + return check_and_exit(sd_device_monitor_get_event(monitor)); return 0; }