diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-02-28 21:23:35 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-02-28 21:23:35 +0000 |
commit | c38c6b14952c25b51b1c0f9fa05aec2d34dc8ddf (patch) | |
tree | 6ab9fab8ff9e4273ce051c7947877e38c1c08ea6 /perl-install/partition_table_raw.pm | |
parent | dbb92fc24abd933eff171909db38d78e1d2f40c6 (diff) | |
download | drakx-backup-do-not-use-c38c6b14952c25b51b1c0f9fa05aec2d34dc8ddf.tar drakx-backup-do-not-use-c38c6b14952c25b51b1c0f9fa05aec2d34dc8ddf.tar.gz drakx-backup-do-not-use-c38c6b14952c25b51b1c0f9fa05aec2d34dc8ddf.tar.bz2 drakx-backup-do-not-use-c38c6b14952c25b51b1c0f9fa05aec2d34dc8ddf.tar.xz drakx-backup-do-not-use-c38c6b14952c25b51b1c0f9fa05aec2d34dc8ddf.zip |
no_comment
Diffstat (limited to 'perl-install/partition_table_raw.pm')
-rw-r--r-- | perl-install/partition_table_raw.pm | 7 |
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; } |