From c38c6b14952c25b51b1c0f9fa05aec2d34dc8ddf Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 28 Feb 2000 21:23:35 +0000 Subject: no_comment --- perl-install/partition_table_raw.pm | 7 ++++--- 1 file changed, 4 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 a27947bdd..af73da1d1 100644 --- a/perl-install/partition_table_raw.pm +++ b/perl-install/partition_table_raw.pm @@ -76,10 +76,11 @@ sub get_geometry($) { my %geom; @geom{qw(heads sectors cylinders start)} = unpack "CCSL", $g; #- $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}; + if (my $total = c::total_sectors(fileno F)) { + $geom{cylinders} = $total / $geom{heads} / $geom{sectors}; + } - { geom => \%geom, totalsectors => $total }; + { geom => \%geom, totalsectors => $geom{heads} * $geom{sectors} * $geom{cylinders} }; } sub openit($$;$) { sysopen $_[1], $_[0]{file}, $_[2] || 0; } -- cgit v1.2.1