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:
Ed Schouten 2009-11-03 11:41:21 +00:00
parent 8691755dff
commit 8f1c21a6e3

View File

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