Commit 3d54c6ec authored by Wayne Davison's avatar Wayne Davison

Moved the /proc/mounts literal string nearer to the top.

parent 71e27c46
......@@ -20,6 +20,7 @@
use strict;
use Cwd 'abs_path';
my $file = '/proc/mounts';
my $dir = shift || '/';
$dir = abs_path($dir);
$dir =~ s#([^/]*)$##;
......@@ -27,7 +28,7 @@ my $trailing = $1;
$trailing = '' if $trailing eq '.' || !-d "$dir$trailing";
$trailing .= '/' if $trailing ne '';
open(IN, '/proc/mounts') or die $!;
open(IN, $file) or die "Unable to open $file: $!\n";
while (<IN>) {
$_ = (split)[1];
next unless s#^\Q$dir$trailing\E##o && $_ ne '';
......
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