From 104d85906c68c3e5f8d70ad8d9120efc045b6499 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 3 Nov 2009 11:41:21 +0000 Subject: 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. --- sbin/sysctl/sysctl.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'sbin/sysctl') diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 4810c61..38c5038 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -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); } -- cgit v1.1