summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-07-07 21:56:38 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-07-07 21:56:38 +0000
commit1d6f2a4cf0a65a475fee3d56d563ee2798193e2e (patch)
tree29eca878ce148c96e143c5a4f81a00f5a5b7823e /perl-install
parent66d764e0ac969a5b51a35aa342560cdb3680c61c (diff)
downloaddrakx-backup-do-not-use-1d6f2a4cf0a65a475fee3d56d563ee2798193e2e.tar
drakx-backup-do-not-use-1d6f2a4cf0a65a475fee3d56d563ee2798193e2e.tar.gz
drakx-backup-do-not-use-1d6f2a4cf0a65a475fee3d56d563ee2798193e2e.tar.bz2
drakx-backup-do-not-use-1d6f2a4cf0a65a475fee3d56d563ee2798193e2e.tar.xz
drakx-backup-do-not-use-1d6f2a4cf0a65a475fee3d56d563ee2798193e2e.zip
use c::total_sectors() instead of BLKGETSIZE
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/devices.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/perl-install/devices.pm b/perl-install/devices.pm
index 051ec990d..260793e30 100644
--- a/perl-install/devices.pm
+++ b/perl-install/devices.pm
@@ -15,8 +15,9 @@ sub size($) {
my $valid_offset = sub { sysseek(F, $_[0], 0) && sysread(F, my $a, 1) };
#- first try getting the size nicely
- my $size = 0;
- ioctl(F, c::BLKGETSIZE(), $size) and return unpack("i", $size) * $common::SECTORSIZE;
+ if (my $size = c::total_sectors(fileno F)) {
+ return $size * $common::SECTORSIZE;
+ }
#- sad it didn't work, well searching the size using the dichotomy algorithm!
my $low = 0;