Merge pull request #10893 from keszybz/udev-cleanup-followup

Udev cleanup follow-ups
This commit is contained in:
Yu Watanabe 2018-11-23 23:48:44 +09:00 committed by GitHub
commit d43c37bbea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 8 deletions

View file

@ -7,6 +7,7 @@
#include "macro.h"
#include "string-util.h"
#include "strv.h"
#include "time-util.h"
#define PATH_SPLIT_SBIN_BIN(x) x "sbin:" x "bin"

View 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

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);

View file

@ -150,8 +150,6 @@ _public_ const char *udev_device_get_subsystem(struct udev_device *udev_device)
r = sd_device_get_subsystem(udev_device->device, &subsystem);
if (r < 0)
return_with_errno(NULL, r);
if (!subsystem)
return_with_errno(NULL, ENODATA);
return subsystem;
}