From 1d6f2a4cf0a65a475fee3d56d563ee2798193e2e Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 7 Jul 2002 21:56:38 +0000 Subject: use c::total_sectors() instead of BLKGETSIZE --- perl-install/devices.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'perl-install') 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; -- cgit v1.2.1