Actually crack major/minor device numbers from the stat results that we
get when we encounter a character/block device file.
Fixes: 6aace700b7b82d ("mkfs: add a utility to generate protofiles")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
if stat.S_ISREG(statbuf.st_mode):
return ' %s' % fullpath
elif stat.S_ISCHR(statbuf.st_mode) or stat.S_ISBLK(statbuf.st_mode):
- return ' %d %d' % (statbuf.st_rdev, statbuf.st_rdev)
+ return ' %d %d' % (os.major(statbuf.st_rdev), os.minor(statbuf.st_rdev))
elif stat.S_ISLNK(statbuf.st_mode):
return ' %s' % os.readlink(fullpath)
return ''