]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
xapcmd: suppress opendir + my usage warning
authorEric Wong <e@80x24.org>
Wed, 27 Nov 2024 02:35:17 +0000 (02:35 +0000)
committerEric Wong <e@80x24.org>
Wed, 27 Nov 2024 20:35:00 +0000 (20:35 +0000)
Apparently perl gets confused here regardless of autodie, so we
add a parenthese around the subroutine call to disambiguate.
This only appears to happen when the target directory name is a
scalar variable and not if it's a constant and when the result
of opendir isn't explicitly checked.

lib/PublicInbox/Xapcmd.pm

index 4af50ea81ba2e72cef642388cd8f159e6e2c0128..2ec0c073c7641f3f57511a0de69a9cc6247f93d9 100644 (file)
@@ -217,7 +217,7 @@ sub prepare_run {
                PublicInbox::Syscall::nodatacow_dir($wip->dirname);
                push @queue, [ $old, $wip ];
        } elsif (defined $old) {
-               opendir my $dh, $old;
+               opendir(my $dh, $old);
                my @old_shards;
                while (defined(my $dn = readdir($dh))) {
                        if ($dn =~ /\A[0-9]+\z/) {