user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <>
Subject: [PATCH] lei: use open() perlop for -C (chdir)
Date: Tue, 22 Jun 2021 10:04:36 +0000	[thread overview]
Message-ID: <> (raw)

This is for consistency with the open() at initial accept, in
case we hit a code path which expects Perl directory handles
rather than "file handles".  Both work with the chdir() perlop
(fchdir(2), in our case).
 lib/PublicInbox/ | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/PublicInbox/ b/lib/PublicInbox/
index 546fa773..cffe4dce 100644
--- a/lib/PublicInbox/
+++ b/lib/PublicInbox/
@@ -762,11 +762,7 @@ sub dispatch {
 				next if $d eq ''; # same as git(1)
 				chdir $d or return fail($self, "cd $d: $!");
-			if (delete $self->{3}) { # update cwd for rel2abs
-				opendir my $dh, '.' or
-					return fail($self, "opendir . $!");
-				$self->{3} = $dh;
-			}
+			open $self->{3}, '.' or return fail($self, "open . $!");
 		$cb->($self, @argv);
 	} elsif (grep(/\A-/, $cmd, @argv)) { # --help or -h only

                 reply	other threads:[~2021-06-22 10:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \
    --subject='Re: [PATCH] lei: use open() perlop for -C (chdir)' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

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).