From c562646b16c5bf75d78616e90134160cec93f2be Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 31 Jan 2011 20:49:26 +0100 Subject: vdf: Properly ignore mountpoints Filesys::Df cannot handle --- bin/vdf | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'bin/vdf') 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; -- cgit v1.2.3