diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-01-29 20:18:18 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-01-29 20:18:18 +0000 |
commit | f180b94c3fc2b56f541a0cb7f748e1bb89b096ae (patch) | |
tree | 749ce2dca53e536f47d402e6a50f486839c9bd72 /sbin | |
parent | 12347f20abfbd60e2cd58607cf77db49a402b22c (diff) |
Add do_dump_map() to make command processing more consistent. Pass
1/0 (a.k.a. vverbose/not verbose) do do_dump_map() to differentiate
P/p.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pdisk/pdisk.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sbin/pdisk/pdisk.c b/sbin/pdisk/pdisk.c index c8b1c7da410..a24defe18ee 100644 --- a/sbin/pdisk/pdisk.c +++ b/sbin/pdisk/pdisk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pdisk.c,v 1.79 2016/01/29 14:54:38 krw Exp $ */ +/* $OpenBSD: pdisk.c,v 1.80 2016/01/29 20:18:17 krw Exp $ */ /* * pdisk - an editor for Apple format partition tables @@ -54,6 +54,7 @@ int rflag; /* open device read Only */ static int first_get = 1; +void do_dump_map(struct partition_map *, int); void do_change_map_size(struct partition_map *); void do_create_partition(struct partition_map *, int); void do_delete_partition(struct partition_map *); @@ -174,10 +175,10 @@ edit(struct partition_map **mapp) " w write the partition map to disk\n"); break; case 'P': - show_data_structures(map); + do_dump_map(map, 1); break; case 'p': - dump_partition_map(map); + do_dump_map(map, 0); break; case 'q': if (map->changed) { @@ -493,6 +494,14 @@ do_display_entry(struct partition_map *map) full_dump_partition_entry(map, number); } +void +do_dump_map(struct partition_map *map, int verbose) +{ + if (verbose) + show_data_structures(map); + else + dump_partition_map(map); +} __dead static void usage(void) |