tmpfiles: fix device node major:minor logging to use i->major_minor
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user