Commit e7f3ac8a authored by Dietmar Maurer's avatar Dietmar Maurer

avoid warning if df return negative value for available bytes

parent 18400f07
......@@ -544,14 +544,16 @@ sub get_lvm_mapping {
sub get_mount_info {
my ($dir) = @_;
# Note: df 'available' can be negative, and percentage set to '-'
my $cmd = [ 'df', '-P', '-T', '-B', '1', $dir];
my $res;
my $parser = sub {
my $line = shift;
if (my ($fsid, $fstype, $mp) = $line =~
m|^(\S+.*)\s+(\S+)\s+\d+\s+\d+\s+\d+\s+\d+%\s+(/.*)$|) {
if (my ($fsid, $fstype, undef, $mp) = $line =~
m!(\S+.*)\s+(\S+)\s+\d+\s+\-?\d+\s+\d+\s+(\d+%|-)\s+(/.*)$!) {
$res = {
device => $fsid,
fstype => $fstype,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment