diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-01-31 20:49:26 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-01-31 20:49:26 +0100 |
commit | c562646b16c5bf75d78616e90134160cec93f2be (patch) | |
tree | 3407fa1dbccb95337f15fa1e184427d105478f3b | |
parent | c1d0876ef6ef574becfe356ffa722d1c393331e1 (diff) |
vdf: Properly ignore mountpoints Filesys::Df cannot handle
-rwxr-xr-x | bin/vdf | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -164,21 +164,22 @@ $alpha = $opts{'a'} // 0; open(my $mounts_fh, '<', '/proc/mounts'); while (my $line = <$mounts_fh>) { - push(@mounts, [split(qr{ }, $line)]); -} -close($mounts_fh); - -foreach my $mount (@mounts) { - my ($device, $mountpoint, $type, $flags) = @{$mount}; - + my ($device, $mountpoint, $type, $flags) = split(qr{ }, $line); my $df_ref = df($mountpoint, 1); if (not defined $df_ref) { next; } - $mount->[4] = $df_ref; + push(@mounts, [ + $device, + $mountpoint, + $type, + $flags, + $df_ref + ]); } +close($mounts_fh); @mounts = grep { $_->[0] !~ qr{ ^ ( (root|tmp)fs | none ) $ }x } @mounts; |