]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tmpfiles: fix device node major:minor logging to use i->major_minor 42791/head
authordongshengyuan <545258830@qq.com>
Mon, 29 Jun 2026 02:20:59 +0000 (10:20 +0800)
committerdongshengyuan <545258830@qq.com>
Mon, 29 Jun 2026 09:20:22 +0000 (17:20 +0800)
The debug log after creating a device node passed major(i->mode) and
minor(i->mode) to format the device number, but i->mode holds the
file permission bits (e.g. 0644), not the device number.

The device major:minor is stored in i->major_minor, which is also
what mknodat() receives. Use that field instead so the log correctly
reports the created device number.

Signed-off-by: dongshengyuan <dongshengyuan@uniontech.com>
src/tmpfiles/tmpfiles.c

index 620ab9486e1ec09c4434f8350e8fc71cc5db60b7..923c2c60f74eda69ab764d306225f0f8e0dd409f 100644 (file)
@@ -2569,10 +2569,10 @@ static int create_device(
                 }
         }
 
-        log_debug("%s %s device node \"%s\" %u:%u.",
+        log_debug("%s %s device node \"%s\" " DEVNUM_FORMAT_STR ".",
                   creation_mode_verb_to_string(creation),
                   i->type == CREATE_BLOCK_DEVICE ? "block" : "char",
-                  i->path, major(i->mode), minor(i->mode));
+                  i->path, DEVNUM_FORMAT_VAL(i->major_minor));
 
         return fd_set_perms(c, i, fd, i->path, &st, creation);