summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2020-09-14 15:15:18 +0200
committerBastien Nocera <hadess@hadess.net>2020-09-14 15:47:16 +0200
commit25730cdda1caa2b44fffbf0b8b28c4b1fb3d24c6 (patch)
treeb3b306dee82fb5ba2a3210879550be34b0c83379
parentd0bd1da7a14323497b435b37ec99aa9375e751c1 (diff)
downloadlibgudev-25730cdda1caa2b44fffbf0b8b28c4b1fb3d24c6.tar.gz
gudev: g_udev_device_has_sysfs_attr() is also cached
Follow-up to d0bd1da7a14323497b435b37ec99aa9375e751c1
-rw-r--r--gudev/gudevdevice.c7
1 files 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);