summaryrefslogtreecommitdiffstats
path: root/perl-install/loopback.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-08-04 00:29:32 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-08-04 00:29:32 +0000
commita3d551a6468bd1799197187d185689e3ac9cb4db (patch)
tree4e07ef60416129b6bd1b514536346c33c922791b /perl-install/loopback.pm
parent299573a7ecaf76b17411611dabd08c822f9b6f53 (diff)
downloaddrakx-backup-do-not-use-a3d551a6468bd1799197187d185689e3ac9cb4db.tar
drakx-backup-do-not-use-a3d551a6468bd1799197187d185689e3ac9cb4db.tar.gz
drakx-backup-do-not-use-a3d551a6468bd1799197187d185689e3ac9cb4db.tar.bz2
drakx-backup-do-not-use-a3d551a6468bd1799197187d185689e3ac9cb4db.tar.xz
drakx-backup-do-not-use-a3d551a6468bd1799197187d185689e3ac9cb4db.zip
no_comment
Diffstat (limited to 'perl-install/loopback.pm')
-rw-r--r--perl-install/loopback.pm15
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} || []};
}