From 25730cdda1caa2b44fffbf0b8b28c4b1fb3d24c6 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 14 Sep 2020 15:15:18 +0200 Subject: gudev: g_udev_device_has_sysfs_attr() is also cached Follow-up to d0bd1da7a14323497b435b37ec99aa9375e751c1 --- gudev/gudevdevice.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gudev/gudevdevice.c b/gudev/gudevdevice.c index 6533099..631d126 100644 --- a/gudev/gudevdevice.c +++ b/gudev/gudevdevice.c @@ -743,13 +743,16 @@ g_udev_device_get_sysfs_attr_keys (GUdevDevice *device) * @device: A #GUdevDevice. * @key: Name of sysfs attribute. * - * Check if a the sysfs attribute with the given key exists. + * Check if a the sysfs attribute with the given key exists. The + * retrieved value is cached in the device. Repeated calls will + * return the same result and not check for the presence of the + * attribute again. * * Returns: %TRUE only if the value for @key exist. */ gboolean g_udev_device_has_sysfs_attr (GUdevDevice *device, - const gchar *key) + const gchar *key) { g_return_val_if_fail (G_UDEV_IS_DEVICE (device), FALSE); g_return_val_if_fail (key != NULL, FALSE); -- cgit v1.2.1