sd-device: expose device_cache_sysattr_value() and device_get_cached_sysattr_value()

This commit is contained in:
Yu Watanabe
2021-10-06 16:02:06 +09:00
parent b63dd5aad8
commit 18b1137977
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -18,13 +18,15 @@ static inline int device_new_from_watch_handle(sd_device **ret, int wd) {
}
int device_get_device_id(sd_device *device, const char **ret);
int device_get_devlink_priority(sd_device *device, int *priority);
int device_get_watch_handle(sd_device *device);
int device_get_devnode_mode(sd_device *device, mode_t *mode);
int device_get_devnode_uid(sd_device *device, uid_t *uid);
int device_get_devnode_gid(sd_device *device, gid_t *gid);
int device_cache_sysattr_value(sd_device *device, const char *key, char *value);
int device_get_cached_sysattr_value(sd_device *device, const char *key, const char **ret_value);
void device_seal(sd_device *device);
void device_set_is_initialized(sd_device *device);
int device_set_watch_handle(sd_device *device, int wd);
+2 -2
View File
@@ -1941,7 +1941,7 @@ _public_ int sd_device_get_trigger_uuid(sd_device *device, sd_id128_t *ret) {
return 0;
}
static int device_cache_sysattr_value(sd_device *device, const char *key, char *value) {
int device_cache_sysattr_value(sd_device *device, const char *key, char *value) {
_unused_ _cleanup_free_ char *old_value = NULL;
_cleanup_free_ char *new_key = NULL;
int r;
@@ -1969,7 +1969,7 @@ static int device_cache_sysattr_value(sd_device *device, const char *key, char *
return 0;
}
static int device_get_cached_sysattr_value(sd_device *device, const char *key, const char **ret_value) {
int device_get_cached_sysattr_value(sd_device *device, const char *key, const char **ret_value) {
const char *k = NULL, *value;
assert(device);