From f14aa5ad42e05f3e9124ac5d53b847b5de1eb9c3 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 6 Apr 2022 01:35:04 +0900 Subject: [PATCH] udev: drop unnecessary code Follow-up for 78e278ad48e0d2854f950f261804fde70121820e. --- src/udev/udev-node.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c index c313181041..4afd604860 100644 --- a/src/udev/udev-node.c +++ b/src/udev/udev-node.c @@ -598,11 +598,10 @@ int udev_node_apply_permissions( gid_t gid, OrderedHashmap *seclabel_list) { - const char *devnode, *subsystem; + const char *devnode; bool apply_mode, apply_uid, apply_gid; _cleanup_close_ int node_fd = -1; struct stat stats; - dev_t devnum; int r; assert(dev); @@ -610,17 +609,6 @@ int udev_node_apply_permissions( r = sd_device_get_devname(dev, &devnode); if (r < 0) return log_device_debug_errno(dev, r, "Failed to get devname: %m"); - r = sd_device_get_subsystem(dev, &subsystem); - if (r < 0) - return log_device_debug_errno(dev, r, "Failed to get subsystem: %m"); - r = sd_device_get_devnum(dev, &devnum); - if (r < 0) - return log_device_debug_errno(dev, r, "Failed to get devnum: %m"); - - if (streq(subsystem, "block")) - mode |= S_IFBLK; - else - mode |= S_IFCHR; node_fd = sd_device_open(dev, O_PATH|O_CLOEXEC); if (node_fd < 0) {