summaryrefslogtreecommitdiff
path: root/sbin/pdisk/dump.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2016-01-15 23:05:01 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2016-01-15 23:05:01 +0000
commit5940915483ebc144409779e67ab7b8ad7f7fac30 (patch)
treebcf0074602f31ed68cfab1007b4585b3600e63aa /sbin/pdisk/dump.c
parent90866f2acb4c608381fdcea6204110059b28855d (diff)
We don't need yet another alias for DEV_BSIZE. Use DEV_BSIZE and
nuke PBLOCK_SIZE and another unused #define.
Diffstat (limited to 'sbin/pdisk/dump.c')
-rw-r--r--sbin/pdisk/dump.c16
1 files changed, 9 insertions, 7 deletions
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 <sys/param.h> /* DEV_BSIZE */
+
#include <err.h>
// 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;
}