pid1,sd-device: use PATH_STARTSWITH_SET more

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-11-23 13:37:47 +01:00
parent f5a9bd21b9
commit e5e0a79623
2 changed files with 4 additions and 6 deletions
+3 -3
View File
@@ -793,9 +793,9 @@ _public_ int sd_device_get_subsystem(sd_device *device, const char **ret) {
else if (path_startswith(device->devpath, "/module/"))
r = device_set_subsystem(device, "module");
else if (!(drivers = strstr(syspath, "/drivers/")) &&
(path_startswith(device->devpath, "/subsystem/") ||
path_startswith(device->devpath, "/class/") ||
path_startswith(device->devpath, "/bus/")))
PATH_STARTSWITH_SET(device->devpath, "/subsystem/",
"/class/",
"/bus/"))
r = device_set_subsystem(device, "subsystem");
if (r < 0 && r != -ENOENT)
return log_device_debug_errno(device, r, "sd-device: Failed to set subsystem for %s: %m", device->devpath);