[libgudev/wip/hadess/add-uncached-helpers: 1/2] gudev: g_udev_device_has_sysfs_attr() is also cached




commit 25730cdda1caa2b44fffbf0b8b28c4b1fb3d24c6
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Sep 14 15:15:18 2020 +0200

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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]