From: Eric Wong Date: Wed, 27 Nov 2024 02:35:17 +0000 (+0000) Subject: xapcmd: suppress opendir + my usage warning X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0406b42d531eb2106abea364d9ed4e12293dbe6;p=thirdparty%2Fpublic-inbox.git xapcmd: suppress opendir + my usage warning 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. --- diff --git a/lib/PublicInbox/Xapcmd.pm b/lib/PublicInbox/Xapcmd.pm index 4af50ea81..2ec0c073c 100644 --- a/lib/PublicInbox/Xapcmd.pm +++ b/lib/PublicInbox/Xapcmd.pm @@ -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/) {