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>
}
}
- 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);