summaryrefslogtreecommitdiff
path: root/sys/boot/common/disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot/common/disk.c')
-rw-r--r--sys/boot/common/disk.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/boot/common/disk.c b/sys/boot/common/disk.c
index 804fb6baad9f..54626f7550ae 100644
--- a/sys/boot/common/disk.c
+++ b/sys/boot/common/disk.c
@@ -183,13 +183,14 @@ ptblread(void *d, void *buf, size_t blocks, off_t offset)
}
#define PWIDTH 35
-static void
+static int
ptable_print(void *arg, const char *pname, const struct ptable_entry *part)
{
struct print_args *pa, bsd;
struct open_disk *od;
struct ptable *table;
char line[80];
+ int res;
pa = (struct print_args *)arg;
od = (struct open_disk *)pa->dev->d_opendata;
@@ -200,25 +201,29 @@ ptable_print(void *arg, const char *pname, const struct ptable_entry *part)
display_size(part->end - part->start + 1,
od->sectorsize));
strcat(line, "\n");
- pager_output(line);
+ if (pager_output(line))
+ return 1;
+ res = 0;
if (part->type == PART_FREEBSD) {
/* Open slice with BSD label */
pa->dev->d_offset = part->start;
table = ptable_open(pa->dev, part->end - part->start + 1,
od->sectorsize, ptblread);
if (table == NULL)
- return;
+ return 0;
sprintf(line, " %s%s", pa->prefix, pname);
bsd.dev = pa->dev;
bsd.prefix = line;
bsd.verbose = pa->verbose;
- ptable_iterate(table, &bsd, ptable_print);
+ res = ptable_iterate(table, &bsd, ptable_print);
ptable_close(table);
}
+
+ return (res);
}
#undef PWIDTH
-void
+int
disk_print(struct disk_devdesc *dev, char *prefix, int verbose)
{
struct open_disk *od;
@@ -229,7 +234,7 @@ disk_print(struct disk_devdesc *dev, char *prefix, int verbose)
pa.dev = dev;
pa.prefix = prefix;
pa.verbose = verbose;
- ptable_iterate(od->table, &pa, ptable_print);
+ return (ptable_iterate(od->table, &pa, ptable_print));
}
int