]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-rules: use udev_get_property_value()
authorDavid Tardon <dtardon@redhat.com>
Mon, 13 Nov 2023 15:20:09 +0000 (16:20 +0100)
committerDavid Tardon <dtardon@redhat.com>
Mon, 13 Nov 2023 18:19:04 +0000 (19:19 +0100)
src/udev/udev-rules.c

index abb44e992411123ed20607ddbc47dd4a036111ee..d30c2f923e9e1c2c744eac681405f3f32de0ab40 100644 (file)
@@ -1981,10 +1981,9 @@ static int udev_rule_apply_token_to_event(
         case TK_M_NAME:
                 return token_match_string(token, event->name);
         case TK_M_ENV: {
-                const char *val;
+                const char *val = NULL;
 
-                if (sd_device_get_property_value(dev, token->data, &val) < 0)
-                        val = hashmap_get(properties_list, token->data);
+                (void) device_get_property_value_with_fallback(dev, token->data, properties_list, &val);
 
                 return token_match_string(token, val);
         }