]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: replace sd_device_get_sysattr_value() with device_get_sysattr_value_maybe_from_...
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 15 Sep 2021 04:30:16 +0000 (13:30 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 17 Sep 2021 03:40:11 +0000 (12:40 +0900)
src/udev/udev-event.c
src/udev/udev-rules.c

index 11531236ce341b8f09eb1d38bf31d69c0a229a79..145204b226cb553325075e51fc4bd12316ec76bb 100644 (file)
@@ -30,6 +30,7 @@
 #include "strxcpyx.h"
 #include "udev-builtin.h"
 #include "udev-event.h"
+#include "udev-netlink.h"
 #include "udev-node.h"
 #include "udev-util.h"
 #include "udev-watch.h"
@@ -351,11 +352,11 @@ static ssize_t udev_event_subst_format(
 
                 /* try to read the attribute the device */
                 if (!val)
-                        (void) sd_device_get_sysattr_value(dev, attr, &val);
+                        (void) device_get_sysattr_value_maybe_from_netlink(dev, &event->rtnl, attr, &val);
 
                 /* try to read the attribute of the parent device, other matches have selected */
                 if (!val && event->dev_parent && event->dev_parent != dev)
-                        (void) sd_device_get_sysattr_value(event->dev_parent, attr, &val);
+                        (void) device_get_sysattr_value_maybe_from_netlink(event->dev_parent, &event->rtnl, attr, &val);
 
                 if (!val)
                         goto null_terminate;
index 3759ac84007c6c00d091ee390134cc1f91bbfd40..693c743c574a322ece339bb90015a6ef967c9d31 100644 (file)
@@ -29,6 +29,7 @@
 #include "syslog-util.h"
 #include "udev-builtin.h"
 #include "udev-event.h"
+#include "udev-netlink.h"
 #include "udev-rules.h"
 #include "udev-util.h"
 #include "user-util.h"
@@ -1396,7 +1397,7 @@ static bool token_match_attr(UdevRuleToken *token, sd_device *dev, UdevEvent *ev
                 name = nbuf;
                 _fallthrough_;
         case SUBST_TYPE_PLAIN:
-                if (sd_device_get_sysattr_value(dev, name, &value) < 0)
+                if (device_get_sysattr_value_maybe_from_netlink(dev, &event->rtnl, name, &value) < 0)
                         return false;
                 break;
         case SUBST_TYPE_SUBSYS: