]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: use DEVNUM_FORMAT_STR/DEVNUM_FORMAT_VAL more
authorLennart Poettering <lennart@poettering.net>
Thu, 19 Dec 2024 13:26:14 +0000 (14:26 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 19 Dec 2024 14:32:05 +0000 (15:32 +0100)
src/nspawn/nspawn.c

index d465cd58e25f5402ff7ce7b23c659bf2959f5fe9..fbddc5948b0013b91349c816ce6b700f77396ac4 100644 (file)
@@ -42,6 +42,7 @@
 #include "copy.h"
 #include "cpu-set-util.h"
 #include "dev-setup.h"
+#include "devnum-util.h"
 #include "discover-image.h"
 #include "dissect-image.h"
 #include "env-util.h"
@@ -2323,7 +2324,7 @@ static int copy_devnode_one(const char *dest, const char *node, bool ignore_mkno
                 return log_error_errno(r, "Failed to create '%s': %m", dn);
 
         _cleanup_free_ char *sl = NULL;
-        if (asprintf(&sl, "%s/%u:%u", dn, major(st.st_rdev), minor(st.st_rdev)) < 0)
+        if (asprintf(&sl, "%s/" DEVNUM_FORMAT_STR, dn, DEVNUM_FORMAT_VAL(st.st_rdev)) < 0)
                 return log_oom();
 
         _cleanup_free_ char *prefixed = path_join(dest, sl);