summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table_raw.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-02-28 21:23:35 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-02-28 21:23:35 +0000
commitc38c6b14952c25b51b1c0f9fa05aec2d34dc8ddf (patch)
tree6ab9fab8ff9e4273ce051c7947877e38c1c08ea6 /perl-install/partition_table_raw.pm
parentdbb92fc24abd933eff171909db38d78e1d2f40c6 (diff)
downloaddrakx-c38c6b14952c25b51b1c0f9fa05aec2d34dc8ddf.tar
drakx-c38c6b14952c25b51b1c0f9fa05aec2d34dc8ddf.tar.gz
drakx-c38c6b14952c25b51b1c0f9fa05aec2d34dc8ddf.tar.bz2
drakx-c38c6b14952c25b51b1c0f9fa05aec2d34dc8ddf.tar.xz
drakx-c38c6b14952c25b51b1c0f9fa05aec2d34dc8ddf.zip
no_comment
Diffstat (limited to 'perl-install/partition_table_raw.pm')
-rw-r--r--perl-install/partition_table_raw.pm7
1 files changed, 4 insertions, 3 deletions
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; }