mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-11-23 15:00:56 +07:00
Clear sysattr cache if a null pointer is passed (#255)
* Clear sysattr cache if a null pointer is passed * remove tabs
This commit is contained in:
parent
ffc1b77871
commit
b9cc389aab
@ -1557,9 +1557,15 @@ _public_ int udev_device_set_sysattr_value(struct udev_device *udev_device, cons
|
||||
dev = udev_device;
|
||||
if (sysattr == NULL)
|
||||
return -EINVAL;
|
||||
if (value == NULL)
|
||||
value_len = 0;
|
||||
else
|
||||
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);
|
||||
goto out;
|
||||
} else
|
||||
value_len = strlen(value);
|
||||
|
||||
strscpyl(path, sizeof(path), udev_device_get_syspath(dev), "/", sysattr, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user