From 5940915483ebc144409779e67ab7b8ad7f7fac30 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Fri, 15 Jan 2016 23:05:01 +0000 Subject: We don't need yet another alias for DEV_BSIZE. Use DEV_BSIZE and nuke PBLOCK_SIZE and another unused #define. --- sbin/pdisk/dump.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'sbin/pdisk/dump.c') diff --git a/sbin/pdisk/dump.c b/sbin/pdisk/dump.c index 12b6bbda00c..1e3b289211b 100644 --- a/sbin/pdisk/dump.c +++ b/sbin/pdisk/dump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dump.c,v 1.17 2016/01/15 16:39:20 krw Exp $ */ +/* $OpenBSD: dump.c,v 1.18 2016/01/15 23:05:00 krw Exp $ */ // // dump.c - dumping partition maps @@ -27,6 +27,8 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include /* DEV_BSIZE */ + #include // for *printf() @@ -659,13 +661,13 @@ display_patches(partition_map *entry) m = entry->the_map->m; offset = ((long long) entry->data->dpme_pblock_start) * entry->the_map->logical_block; if (patch_block == NULL) { - patch_block = malloc(PBLOCK_SIZE); + patch_block = malloc(DEV_BSIZE); if (patch_block == NULL) { warn("can't allocate memory for patch block buffer"); return; } } - if (read_media(m, (long long)offset, PBLOCK_SIZE, (char *)patch_block) == 0) { + if (read_media(m, (long long)offset, DEV_BSIZE, (char *)patch_block) == 0) { warn("Can't read patch block"); return; } @@ -673,16 +675,16 @@ display_patches(partition_map *entry) if (p->numPatchBlocks != 1) { i = p->numPatchBlocks; free(patch_block); - patch_block = reallocarray(NULL, i, PBLOCK_SIZE); + patch_block = reallocarray(NULL, i, DEV_BSIZE); if (patch_block == NULL) { warn("can't allocate memory for patch blocks buffer"); return; } - s = patch_block + PBLOCK_SIZE*i; + s = patch_block + DEV_BSIZE*i; while (i > 0) { - s -= PBLOCK_SIZE; + s -= DEV_BSIZE; i -= 1; - if (read_media(m, offset+i, PBLOCK_SIZE, (char *)s) == 0) { + if (read_media(m, offset+i, DEV_BSIZE, (char *)s) == 0) { warn("Can't read patch block %d", i); return; } -- cgit v1.2.3