int device_rename(sd_device *device, const char *name) {
_cleanup_free_ char *dirname = NULL;
- char *new_syspath;
- const char *interface;
+ const char *new_syspath, *interface;
int r;
assert(device);
if (!dirname)
return -ENOMEM;
- new_syspath = strjoina(dirname, "/", name);
+ new_syspath = prefix_roota(dirname, name);
/* the user must trust that the new name is correct */
r = device_set_syspath(device, new_syspath, false);
};
DEFINE_STRING_TABLE_LOOKUP(device_action, DeviceAction);
+
+void dump_device_action_table(void) {
+ DUMP_STRING_TABLE(device_action, DeviceAction, _DEVICE_ACTION_MAX);
+}