Just use devname(3) to print device names.
Right now sysctl just prints the major/minor numbers of a device. Instead of rolling our own routine for this, we'd better just call devname(3) to perform a translation to a device name for us.
This commit is contained in:
parent
8691755dff
commit
8f1c21a6e3
@ -419,14 +419,7 @@ T_dev_t(int l2, void *p)
|
||||
warnx("T_dev_T %d != %d", l2, sizeof(*d));
|
||||
return (1);
|
||||
}
|
||||
if ((int)(*d) != -1) {
|
||||
if (minor(*d) > 255 || minor(*d) < 0)
|
||||
printf("{ major = %d, minor = 0x%x }",
|
||||
major(*d), minor(*d));
|
||||
else
|
||||
printf("{ major = %d, minor = %d }",
|
||||
major(*d), minor(*d));
|
||||
}
|
||||
printf("%s", devname(*d, S_IFCHR));
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user