diff options
author | 2016-01-14 04:02:05 +0000 | |
---|---|---|
committer | 2016-01-14 04:02:05 +0000 | |
commit | 7446d16e8033c62569aeb391c075031d262600a8 (patch) | |
tree | 38aee87b2ee15d11e4876bfaf403191b72e87245 | |
parent | stdio.h is not needed here anymore. (diff) | |
download | wireguard-openbsd-7446d16e8033c62569aeb391c075031d262600a8.tar.xz wireguard-openbsd-7446d16e8033c62569aeb391c075031d262600a8.zip |
Remove code supporting undocumented and inaccessible flags 'a'
(abbreviate partition type names), 'f' (print HFS partition names)
and 'kLogicalOption' (obviously a getopt_long() conversion error).
-rw-r--r-- | sbin/pdisk/dump.c | 54 | ||||
-rw-r--r-- | sbin/pdisk/dump.h | 8 | ||||
-rw-r--r-- | sbin/pdisk/pdisk.c | 10 |
3 files changed, 11 insertions, 61 deletions
diff --git a/sbin/pdisk/dump.c b/sbin/pdisk/dump.c index f35b97609b0..7c54083d196 100644 --- a/sbin/pdisk/dump.c +++ b/sbin/pdisk/dump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dump.c,v 1.15 2016/01/12 20:09:39 krw Exp $ */ +/* $OpenBSD: dump.c,v 1.16 2016/01/14 04:02:05 krw Exp $ */ // // dump.c - dumping partition maps @@ -112,9 +112,6 @@ const char * kStringNot = " not"; // // Global Variables // -int aflag = AFLAG_DEFAULT; /* abbreviate partition types */ -int pflag = PFLAG_DEFAULT; /* show physical limits of partition */ -int fflag = FFLAG_DEFAULT; /* show HFS volume names */ // @@ -211,13 +208,9 @@ dump_partition_map(partition_map_header *map, int disk_order) if (digits < 6) { digits = 6; } - if (aflag) { - max_type_length = 4; - } else { - max_type_length = get_max_type_string_length(map); - if (max_type_length < 4) { - max_type_length = 4; - } + max_type_length = get_max_type_string_length(map); + if (max_type_length < 4) { + max_type_length = 4; } max_name_length = get_max_name_string_length(map); if (max_name_length < 6) { @@ -264,26 +257,11 @@ dump_partition_entry(partition_map *entry, int type_length, int name_length, int map = entry->the_map; p = entry->data; driver = entry->contains_driver? '*': ' '; - if (aflag) { - s = "????"; - for (j = 0; plist[j].abbr != 0; j++) { - if (strcmp(p->dpme_type, plist[j].full) == 0) { - s = plist[j].abbr; - break; - } - } - printf("%2ld: %.4s", entry->disk_address, s); - } else { - printf("%2ld: %*.32s", entry->disk_address, type_length, p->dpme_type); - } + printf("%2ld: %*.32s", entry->disk_address, type_length, p->dpme_type); buf = malloc(name_length+1); - if (entry->HFS_name == NULL || fflag == 0) { - strncpy(buf, p->dpme_name, name_length); - buf[name_length] = 0; - } else { - snprintf(buf, name_length + 1, "\"%s\"", entry->HFS_name); - } + strncpy(buf, p->dpme_name, name_length); + buf[name_length] = 0; printf("%c%-*.32s ", driver, name_length, buf); free(buf); /* @@ -297,10 +275,7 @@ dump_partition_entry(partition_map *entry, int type_length, int name_length, int printf("%c ", kind); */ - if (pflag) { - printf("%*lu ", digits, p->dpme_pblocks); - size = p->dpme_pblocks; - } else if (p->dpme_lblocks + p->dpme_lblock_start != p->dpme_pblocks) { + if (p->dpme_lblocks + p->dpme_lblock_start != p->dpme_pblocks) { printf("%*lu+", digits, p->dpme_lblocks); size = p->dpme_lblocks; } else if (p->dpme_lblock_start != 0) { @@ -310,7 +285,7 @@ dump_partition_entry(partition_map *entry, int type_length, int name_length, int printf("%*lu ", digits, p->dpme_pblocks); size = p->dpme_pblocks; } - if (pflag || p->dpme_lblock_start == 0) { + if (p->dpme_lblock_start == 0) { printf("@ %-*lu", digits, p->dpme_pblock_start); } else { printf("@~%-*lu", digits, p->dpme_pblock_start + p->dpme_lblock_start); @@ -774,17 +749,6 @@ get_max_name_string_length(partition_map_header *map) if (length > max) { max = length; } - - if (fflag) { - if (entry->HFS_name == NULL) { - length = 0; - } else { - length = strlen(entry->HFS_name) + 2; - } - if (length > max) { - max = length; - } - } } return max; diff --git a/sbin/pdisk/dump.h b/sbin/pdisk/dump.h index eae27c1d83f..941abffc69f 100644 --- a/sbin/pdisk/dump.h +++ b/sbin/pdisk/dump.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dump.h,v 1.5 2016/01/11 07:54:07 jasper Exp $ */ +/* $OpenBSD: dump.h,v 1.6 2016/01/14 04:02:05 krw Exp $ */ // // dump.h - dumping partition maps @@ -36,9 +36,6 @@ // // Defines // -#define AFLAG_DEFAULT 0 -#define PFLAG_DEFAULT 1 -#define FFLAG_DEFAULT 0 // @@ -54,9 +51,6 @@ // // Global Variables // -extern int aflag; -extern int pflag; -extern int fflag; // diff --git a/sbin/pdisk/pdisk.c b/sbin/pdisk/pdisk.c index da16012f06c..d699051aca3 100644 --- a/sbin/pdisk/pdisk.c +++ b/sbin/pdisk/pdisk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pdisk.c,v 1.29 2016/01/13 00:29:25 krw Exp $ */ +/* $OpenBSD: pdisk.c,v 1.30 2016/01/14 04:02:05 krw Exp $ */ // // pdisk - an editor for Apple format partition tables @@ -167,8 +167,6 @@ get_options(int argc, char **argv) lfile = NULL; dflag = DFLAG_DEFAULT; rflag = RFLAG_DEFAULT; - aflag = AFLAG_DEFAULT; - pflag = PFLAG_DEFAULT; optind = 1; // reset option scanner logic while ((c = getopt(argc, argv, "ldr")) != -1) { @@ -182,12 +180,6 @@ get_options(int argc, char **argv) case 'r': rflag = (RFLAG_DEFAULT)?0:1; break; - case 'a': - aflag = (AFLAG_DEFAULT)?0:1; - break; - case kLogicalOption: - pflag = (PFLAG_DEFAULT)?0:1; - break; default: usage(); break; |