diff options
author | Bastien Nocera <hadess@hadess.net> | 2020-09-14 15:15:18 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2020-09-14 15:47:16 +0200 |
commit | 25730cdda1caa2b44fffbf0b8b28c4b1fb3d24c6 (patch) | |
tree | b3b306dee82fb5ba2a3210879550be34b0c83379 | |
parent | d0bd1da7a14323497b435b37ec99aa9375e751c1 (diff) | |
download | libgudev-25730cdda1caa2b44fffbf0b8b28c4b1fb3d24c6.tar.gz |
gudev: g_udev_device_has_sysfs_attr() is also cached
Follow-up to d0bd1da7a14323497b435b37ec99aa9375e751c1
-rw-r--r-- | gudev/gudevdevice.c | 7 |
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); |