]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/libsystemd/sd-device/device-private.c
Merge pull request #12750 from keszybz/tmpfiles-c-copy
[thirdparty/systemd.git] / src / libsystemd / sd-device / device-private.c
index a0855001e308f1af59951d253fa7ae8e8407625b..16f8627bdbc147a511f58d38b980f8180d0d442d 100644 (file)
@@ -609,8 +609,7 @@ void device_set_watch_handle(sd_device *device, int handle) {
 
 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);
@@ -620,7 +619,7 @@ int device_rename(sd_device *device, const char *name) {
         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);
@@ -999,3 +998,7 @@ static const char* const device_action_table[_DEVICE_ACTION_MAX] = {
 };
 
 DEFINE_STRING_TABLE_LOOKUP(device_action, DeviceAction);
+
+void dump_device_action_table(void) {
+        DUMP_STRING_TABLE(device_action, DeviceAction, _DEVICE_ACTION_MAX);
+}