summaryrefslogtreecommitdiff
path: root/bin/vdf
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-01-31 20:49:26 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-01-31 20:49:26 +0100
commitc562646b16c5bf75d78616e90134160cec93f2be (patch)
tree3407fa1dbccb95337f15fa1e184427d105478f3b /bin/vdf
parentc1d0876ef6ef574becfe356ffa722d1c393331e1 (diff)
vdf: Properly ignore mountpoints Filesys::Df cannot handle
Diffstat (limited to 'bin/vdf')
-rwxr-xr-xbin/vdf17
1 files changed, 9 insertions, 8 deletions
diff --git a/bin/vdf b/bin/vdf
index d4aad7b..488ec33 100755
--- a/bin/vdf
+++ b/bin/vdf
@@ -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;