From b665d3c80aa66b6f440ead49ac606e0702ffefd9 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 14 Feb 2000 13:53:43 +0000 Subject: no_comment --- perl-install/partition_table_raw.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'perl-install/partition_table_raw.pm') diff --git a/perl-install/partition_table_raw.pm b/perl-install/partition_table_raw.pm index 41a49d552..d1399f230 100644 --- a/perl-install/partition_table_raw.pm +++ b/perl-install/partition_table_raw.pm @@ -73,11 +73,13 @@ sub get_geometry($) { local *F; sysopen F, $dev, 0 or return; ioctl(F, c::HDIO_GETGEO(), $g) or return; - my %geom; @geom{qw(heads sectors cylinders start)} = unpack "CCSL", $g; - $geom{totalcylinders} = $geom{cylinders}; - { geom => \%geom, totalsectors => $geom{heads} * $geom{sectors} * $geom{cylinders} }; + #- $geom{cylinders} is no good (only a ushort, that means less than 2^16 => at best 512MB) + my $total = c::total_sectors(fileno F); + $geom{totalcylinders} = $total / $geom{heads} * $geom{sectors}; + + { geom => \%geom, totalsectors => $total }; } sub openit($$;$) { sysopen $_[1], $_[0]{file}, $_[2] || 0; } -- cgit v1.2.1