]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device: expose device_cache_sysattr_value() and device_get_cached_sysattr_value()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 15 Sep 2021 03:14:46 +0000 (12:14 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 17 Sep 2021 03:40:09 +0000 (12:40 +0900)
src/libsystemd/sd-device/device-private.h
src/libsystemd/sd-device/sd-device.c

index 9bb5eff208b83ca42b619b1f4f3511d0031a91bb..04b932309cfecf46680a44d66554f064e43962b7 100644 (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);
index e06b6276dc6691c62e722b59a0a6d2d80b31a55e..d54275ccc7933900348d6c0a0be7942d3da959f1 100644 (file)
@@ -1940,7 +1940,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;
@@ -1968,7 +1968,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);