mirror of
https://github.com/systemd/systemd.git
synced 2024-11-27 20:23:36 +08:00
sd-device: introduce tiny wrapper sd_device_trigger()
This commit is contained in:
parent
297d1370f8
commit
f4d36efa75
@ -749,4 +749,5 @@ global:
|
||||
sd_device_get_action;
|
||||
sd_device_get_seqnum;
|
||||
sd_device_new_from_stat_rdev;
|
||||
sd_device_trigger;
|
||||
} LIBSYSTEMD_247;
|
||||
|
@ -2036,3 +2036,15 @@ _public_ int sd_device_set_sysattr_valuef(sd_device *device, const char *sysattr
|
||||
|
||||
return sd_device_set_sysattr_value(device, sysattr, value);
|
||||
}
|
||||
|
||||
_public_ int sd_device_trigger(sd_device *device, sd_device_action_t action) {
|
||||
const char *s;
|
||||
|
||||
assert_return(device, -EINVAL);
|
||||
|
||||
s = device_action_to_string(action);
|
||||
if (!s)
|
||||
return -EINVAL;
|
||||
|
||||
return sd_device_set_sysattr_value(device, "uevent", s);
|
||||
}
|
||||
|
@ -99,6 +99,7 @@ int sd_device_get_sysattr_value(sd_device *device, const char *sysattr, const ch
|
||||
|
||||
int sd_device_set_sysattr_value(sd_device *device, const char *sysattr, const char *value);
|
||||
int sd_device_set_sysattr_valuef(sd_device *device, const char *sysattr, const char *format, ...) _sd_printf_(3, 4);
|
||||
int sd_device_trigger(sd_device *device, sd_device_action_t action);
|
||||
|
||||
/* device enumerator */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user