-
Notifications
You must be signed in to change notification settings - Fork 143
Battery status remains unchanged with eudev pre 3.2.14 and libgudev 238 #254
Copy link
Copy link
Closed
Description
This issue is completely irrelevant with a current tag implementation.
A cause of the problem is that the behavior of udev_device_set_sysattr_value() in udev is recently modified so that
a cache value of sysfs attr is cleared when it is called with a null pointer value.
According to this change, libgudev's g_udev_device_get_sysfs_attr_uncached is quite simplified in version 238 like
udev_device_set_sysattr_value (device->priv->udevice, name, NULL);
return g_udev_device_get_sysfs_attr (device, name);
Under the above implementation, for example, upower always get cached values of battery state because the current eudev does not clear cached values in udev_device_set_sysattr_value() call with a null pointer value.
A solution is very easy to add the following code in udev_device_set_sysattr_value:
if (value == NULL) {
struct udev_list_entry *list_entry;
list_entry = udev_list_get_entry(&udev_device->sysattr_value_list);
list_entry = udev_list_entry_get_by_name(list_entry, sysattr);
if (list_entry != NULL)
udev_list_entry_delete(list_entry);
ret = 0;
goto out;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels