diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-08-04 00:29:32 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-08-04 00:29:32 +0000 |
commit | a3d551a6468bd1799197187d185689e3ac9cb4db (patch) | |
tree | 4e07ef60416129b6bd1b514536346c33c922791b /perl-install/loopback.pm | |
parent | 299573a7ecaf76b17411611dabd08c822f9b6f53 (diff) | |
download | drakx-a3d551a6468bd1799197187d185689e3ac9cb4db.tar drakx-a3d551a6468bd1799197187d185689e3ac9cb4db.tar.gz drakx-a3d551a6468bd1799197187d185689e3ac9cb4db.tar.bz2 drakx-a3d551a6468bd1799197187d185689e3ac9cb4db.tar.xz drakx-a3d551a6468bd1799197187d185689e3ac9cb4db.zip |
no_comment
Diffstat (limited to 'perl-install/loopback.pm')
-rw-r--r-- | perl-install/loopback.pm | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/perl-install/loopback.pm b/perl-install/loopback.pm index da89f1e5e..1a90e1091 100644 --- a/perl-install/loopback.pm +++ b/perl-install/loopback.pm @@ -99,18 +99,9 @@ sub inspect { sub getFree { my ($dir, $part) = @_; - my ($freespace); - - if ($dir) { - my $buf = ' ' x 20000; - syscall_('statfs', $dir, $buf) or return; - my (undef, $blocksize, $size, undef, $free, undef) = unpack "L2L4", $buf; - $_ *= $blocksize / 512 foreach $free; - - $freespace = $free; - } else { - $freespace = $part->{size}; - } + my $freespace = $dir ? + 2 * (common::df($dir))[1] : #- df in KiB + $part->{size}; $freespace - sum map { $_->{size} } @{$part->{loopback} || []}; } |