forked from pool/parted
Copy from home:puzel:branches:Base:System/parted via accept of submit request 36773 revision 8. Request was accepted with message: OBS-URL: https://build.opensuse.org/request/show/36773 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=19
27 lines
1.2 KiB
Diff
27 lines
1.2 KiB
Diff
Index: parted/parted.c
|
|
===================================================================
|
|
--- parted/parted.c.orig 2010-04-02 10:22:16.000000000 +0200
|
|
+++ parted/parted.c 2010-04-02 10:40:03.000000000 +0200
|
|
@@ -1435,8 +1435,20 @@ do_print (PedDevice** dev)
|
|
wchar_t* table_rendered;
|
|
|
|
disk = ped_disk_new (*dev);
|
|
- if (!disk)
|
|
+ if (!disk) {
|
|
+ if (ped_unit_get_default () == PED_UNIT_CHS ||
|
|
+ ped_unit_get_default () == PED_UNIT_CYLINDER) {
|
|
+ PedCHSGeometry* chs = &(*dev)->bios_geom;
|
|
+ char* cyl_size = ped_unit_format_custom (*dev,
|
|
+ chs->heads * chs->sectors,
|
|
+ PED_UNIT_KILOBYTE);
|
|
+ printf (_("BIOS cylinder,head,sector geometry: %d,%d,%d. "
|
|
+ "Each cylinder is %s.\n"),
|
|
+ chs->cylinders, chs->heads, chs->sectors, cyl_size);
|
|
+ free (cyl_size);
|
|
+ }
|
|
goto error;
|
|
+ }
|
|
|
|
if (ped_disk_is_flag_available(disk, PED_DISK_CYLINDER_ALIGNMENT))
|
|
if (!ped_disk_set_flag(disk, PED_DISK_CYLINDER_ALIGNMENT,
|