From 5b03e4b6a1eb6c4a25cf8aa27ef92ab7e1c0222a Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Thu, 3 Apr 2003 21:41:14 +0000 Subject: [PATCH] Output machdep.guessed_bootdev as an integer rather than try to format it according to ancient and obsolete rules. This removes one more user of --- sbin/sysctl/sysctl.c | 54 -------------------------------------------- 1 file changed, 54 deletions(-) diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index d843d84280a0..7442a3213121 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -46,7 +46,6 @@ static const char rcsid[] = #endif /* not lint */ #ifdef __i386__ -#include /* used for bootdev parsing */ #include /* used for bootdev parsing */ #endif #include @@ -451,55 +450,6 @@ oidfmt(int *oid, int len, char *fmt, u_int *kind) return 0; } -#ifdef __i386__ -/* - * Code to map a bootdev major number into a suitable device name. - * Major numbers are mapped into names as in boot2.c - */ -struct _foo { - int majdev; - char *name; -} maj2name[] = { - 30, "ad", - 0, "wd", - 1, "wfd", - 2, "fd", - 4, "da", - -1, NULL /* terminator */ -}; - -static int -machdep_bootdev(u_long value) -{ - int majdev, unit, slice, part; - struct _foo *p; - - if (value & B_MAGICMASK != B_DEVMAGIC) { - printf("invalid (0x%08x)", value); - return 0; - } - majdev = B_TYPE(value); - unit = B_UNIT(value); - slice = B_SLICE(value); - part = B_PARTITION(value); - if (majdev == 2) { /* floppy, as known to the boot block... */ - printf("/dev/fd%d", unit); - return 0; - } - for (p = maj2name; p->name != NULL && p->majdev != majdev ; p++) ; - if (p->name != NULL) { /* found */ - if (slice == WHOLE_DISK_SLICE) - printf("/dev/%s%d%c", p->name, unit, part); - else - printf("/dev/%s%ds%d%c", - p->name, unit, slice - BASE_SLICE + 1, part + 'a'); - } else - printf("unknown (major %d unit %d slice %d part %d)", - majdev, unit, slice, part); - return 0; -} -#endif - /* * This formats and outputs the value of one variable * @@ -593,10 +543,6 @@ show_var(int *oid, int nlen) if (!nflag) printf("%s%s", name, sep); fmt++; -#ifdef __i386__ - if (!strcmp(name, "machdep.guessed_bootdev")) - return machdep_bootdev(*(unsigned long *)p); -#endif val = ""; while (len >= sizeof(long)) { if(*fmt == 'U')