summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-09-03 02:09:06 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-09-06 06:09:55 +0900
commite063db12c3ced5b68ac1cbc7b240b425f0689950 (patch)
treeeb1da3f76d011e4cec27ff33de697b722ea8dab0
parentf6bb2e5189979d6888dffefad1ede39210ace2b0 (diff)
downloadsystemd-e063db12c3ced5b68ac1cbc7b240b425f0689950.tar.gz
udevadm-wait: shorten code a bit
-rw-r--r--src/udev/udevadm-wait.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/udev/udevadm-wait.c b/src/udev/udevadm-wait.c
index 53fdacb867..544c94616d 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;
}