diff options
Diffstat (limited to 'lib/MDK/Common/System.pm')
-rw-r--r-- | lib/MDK/Common/System.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/MDK/Common/System.pm b/lib/MDK/Common/System.pm index 1b24f21..f7d0f63 100644 --- a/lib/MDK/Common/System.pm +++ b/lib/MDK/Common/System.pm @@ -310,7 +310,13 @@ sub df { my ($blocksize, $size, $free); my $buf = ' ' x 20000; syscall_('statfs', $mntpoint, $buf) or return; - (undef, $blocksize, $size, $free, undef, undef) = unpack "L!6", $buf; + # at least on mips the statfs structure is different to x86 + # Should we use bavail or bfree ? + if (arch() =~ /mips/) { + (undef, $blocksize, undef, $size, $free, undef, undef, $avail) = unpack "L!8", $buf; + } else { + (undef, $blocksize, $size, $free, undef, undef) = unpack "L!6", $buf; + } map { $_ * ($blocksize / 1024) } $size, $free; } |