mirror of
https://github.com/speed47/btrfs-list
synced 2024-06-28 22:14:36 +00:00
enh: remove mountpoint
dependency
This commit is contained in:
parent
fcf4a98f85
commit
410a002fa9
11
btrfs-list
11
btrfs-list
|
@ -366,14 +366,19 @@ while (<$procfd>) {
|
|||
close($procfd);
|
||||
|
||||
# first ensure passed wantedFs is a mountpoint
|
||||
my $originalWantedFs = $wantedFs;
|
||||
if ($wantedFs) {
|
||||
$wantedFs =~ s{/+}{/}g;
|
||||
$wantedFs =~ s{/$}{};
|
||||
my $originalWantedFs = $wantedFs;
|
||||
while (1) {
|
||||
$wantedFs ||= '/';
|
||||
$cmd = run_cmd(cmd => ['mountpoint', $wantedFs], silent_stderr => 1);
|
||||
if ($cmd->{'status'} != 0) {
|
||||
my $ismp = 0;
|
||||
foreach (@procmounts) {
|
||||
next if ($_->{mp} ne $wantedFs);
|
||||
$ismp = 1;
|
||||
last;
|
||||
}
|
||||
if (!$ismp) {
|
||||
next if ($wantedFs =~ s{/[^/]+$}{});
|
||||
last;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user