diff options
author | phk <phk@FreeBSD.org> | 2003-04-03 21:41:14 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-04-03 21:41:14 +0000 |
commit | 383d50b298f5c5c45b14f5aa964f3c4a771823e2 (patch) | |
tree | c5728d7f7400ef4e7cecd01ee325ce41af112149 /sbin/sysctl | |
parent | 96d4258af94bd2a9eec38eda0969044389c23d91 (diff) | |
download | FreeBSD-src-383d50b298f5c5c45b14f5aa964f3c4a771823e2.zip FreeBSD-src-383d50b298f5c5c45b14f5aa964f3c4a771823e2.tar.gz |
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 <sys/diskslice.h>
Diffstat (limited to 'sbin/sysctl')
-rw-r--r-- | sbin/sysctl/sysctl.c | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index d843d84..7442a32 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 <sys/diskslice.h> /* used for bootdev parsing */ #include <sys/reboot.h> /* used for bootdev parsing */ #endif #include <sys/param.h> @@ -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') |