]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pid1,sd-device: use PATH_STARTSWITH_SET more 10893/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 23 Nov 2018 08:24:26 +0000 (09:24 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 23 Nov 2018 12:37:47 +0000 (13:37 +0100)
src/core/umount.c
src/libsystemd/sd-device/sd-device.c

index 47313da231060f98e99727af8f03a4908f9d1a1a..9e6c404ab960e0e4016476975f27e41413714135 100644 (file)
@@ -121,9 +121,7 @@ int mount_points_list_get(const char *mountinfo, MountPoint **head) {
                  * unmount these things, hence don't bother. */
                 if (mount_point_is_api(p) ||
                     mount_point_ignore(p) ||
-                    path_startswith(p, "/dev") ||
-                    path_startswith(p, "/sys") ||
-                    path_startswith(p, "/proc"))
+                    PATH_STARTSWITH_SET(p, "/dev", "/sys", "/proc"))
                         continue;
 
                 /* If we are in a container, don't attempt to
index d8df1250feea0c58cfac74661ccc011fcbb2d461..dc75f91e21cda5983a6b7b3d015c8d7e723187e8 100644 (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);