parse_partition_table can fail for two reasons: disk I/O
error or unrecognized partition layout (non msdos, corrupt, ...).
In the latter case, we were displaying
Error parsing disk 0x80
parse_partition_table: error 0
which is confusing. We now display
Disk 0x80: unrecognized partition layout
or the errno_disk in case of I/O errors.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
remove_spaces(d->edd_params.host_bus_type), remove_spaces(d->edd_params.interface_type));
if (parse_partition_table(d, &show_partition_information)) {
- fprintf(stderr, "Error parsing disk 0x%X\n", d->disk);
- get_error("parse_partition_table");
+ if (errno_disk) {
+ fprintf(stderr, "I/O error parsing disk 0x%X\n", d->disk);
+ get_error("parse_partition_table");
+ } else {
+ fprintf(stderr, "Disk 0x%X: unrecognized partition layout\n", d->disk);
+ }
+ fprintf(stderr, "\n");
}
}