mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-10-24 14:48:16 -04:00
Moved the /proc/mounts literal string nearer to the top.
This commit is contained in:
1 parent
71e27c463d
commit
3d54c6ec46
1 file changed
+2
-1
+2
-1
@@ -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 '';
|
||||
|
||||
Reference in new issue
Block a user