diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 062b95182c..2e68de9e63 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -886,11 +886,9 @@ bool hidden_or_backup_file(const char *filename) { bool is_device_path(const char *path) { - /* Returns true on paths that refer to a device, either in - * sysfs or in /dev */ + /* Returns true on paths that likely refer to a device, either by path in sysfs or to something in /dev */ - return path_startswith(path, "/dev/") || - path_startswith(path, "/sys/"); + return PATH_STARTSWITH_SET(path, "/dev/", "/sys/"); } bool valid_device_node_path(const char *path) { diff --git a/src/core/device.c b/src/core/device.c index 915991bf90..3219c850ed 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -546,8 +546,7 @@ static int device_process_new(Manager *m, struct udev_device *dev) { /* Don't bother with the /dev/block links */ p = udev_list_entry_get_name(item); - if (path_startswith(p, "/dev/block/") || - path_startswith(p, "/dev/char/")) + if (PATH_STARTSWITH_SET(p, "/dev/block/", "/dev/char/")) continue; /* Verify that the symlink in the FS actually belongs