aboutsummaryrefslogtreecommitdiffstats
path: root/com32/hdt/hdt-cli-disk.c
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-08-22 10:34:40 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-08-22 10:34:40 -0700
commit6bc9a8305bca8c933da90481f536407b733b806f (patch)
tree9badd4478a322ed163d7cfb70ee91fc134d4c98b /com32/hdt/hdt-cli-disk.c
parentb3514f90bf55e5a1f277cbcf83afa509b9d13acc (diff)
downloadhdt-6bc9a8305bca8c933da90481f536407b733b806f.tar.gz
hdt-6bc9a8305bca8c933da90481f536407b733b806f.tar.xz
hdt-6bc9a8305bca8c933da90481f536407b733b806f.zip
hdt: make get_error behaves like perror
This simplifies buffer handling. Misc.: clean some old error code handling. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32/hdt/hdt-cli-disk.c')
-rw-r--r--com32/hdt/hdt-cli-disk.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/com32/hdt/hdt-cli-disk.c b/com32/hdt/hdt-cli-disk.c
index 080e1327..fec98a15 100644
--- a/com32/hdt/hdt-cli-disk.c
+++ b/com32/hdt/hdt-cli-disk.c
@@ -64,8 +64,6 @@ static void show_partition_information(struct driveinfo *drive_info,
{
char size[9];
char *parttype;
- int error = 0;
- char error_buffer[MAX_DISK_ERRNO];
unsigned int start, end;
int i = nb_partitions_seen;
@@ -90,12 +88,8 @@ static void show_partition_information(struct driveinfo *drive_info,
ptab->ostype, parttype);
/* Extra info */
- if (ptab->ostype == 0x82 && swsusp_check(drive_info, ptab)) {
+ if (ptab->ostype == 0x82 && swsusp_check(drive_info, ptab))
more_printf("%s", " (Swsusp sig. detected)");
- } else if (error) {
- get_error(&error_buffer);
- more_printf("%s\n", error_buffer);
- }
more_printf("\n");
@@ -120,7 +114,6 @@ void main_show_disk(int argc, char **argv,
int i = drive - 0x80;
struct driveinfo *d = &hardware->disk_info[i];
- char error_buffer[MAX_DISK_ERRNO];
char disk_size[9];
detect_disks(hardware);
@@ -143,9 +136,9 @@ void main_show_disk(int argc, char **argv,
disk_size, (int) d->edd_params.bytes_per_sector, (int) d->edd_params.sectors_per_track,
remove_spaces(d->edd_params.host_bus_type), remove_spaces(d->edd_params.interface_type));
- if (parse_partition_table(d, &show_partition_information) == -1) {
- get_error(&error_buffer);
- more_printf("%s\n", error_buffer);
+ if (parse_partition_table(d, &show_partition_information)) {
+ fprintf(stderr, "Error parsing disk 0x%X\n", d->disk);
+ get_error("parse_partition_table");
}
}