unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] xapcmd: suppress opendir + my usage warning
@ 2024-11-27  2:35 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2024-11-27  2:35 UTC (permalink / raw)
  To: meta

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/Xapcmd.pm b/lib/PublicInbox/Xapcmd.pm
index 4af50ea8..2ec0c073 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/) {

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-11-27  2:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-27  2:35 [PATCH] xapcmd: suppress opendir + my usage warning Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).