summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index f953785b6..9e02cb149 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -238,9 +238,11 @@ sub getAvailableSpace {
sub getAvailableSpace_mounted {
my ($prefix) = @_;
my $buf = ' ' x 20000;
- syscall_('statfs', "$prefix/usr", $buf) or return;
+ my $dir = -d "$prefix/usr" ? "$prefix/usr" : "$prefix";
+ syscall_('statfs', $dir, $buf) or return;
my (undef, $blocksize, $size, undef, $free, undef) = unpack "L2L4", $buf;
- ($free || 1) * $blocksize;
+ log::l("space free on $dir is $free blocks of $blocksize bytes");
+ $free * $blocksize || 1;
}
sub getAvailableSpace_raw {
my ($fstab) = @_;