]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
clone: don't dup(2) stdout FD
authorEric Wong <e@80x24.org>
Tue, 29 Apr 2025 20:47:42 +0000 (20:47 +0000)
committerEric Wong <e@80x24.org>
Thu, 1 May 2025 21:29:46 +0000 (21:29 +0000)
Avoiding close(2) on stdout doesn't seem to be worth it anyways,
as lei code shouldn't be closing FDs unless they fail (e.g.
SIGPIPE), in which case keeping a duplicate FD isn't doing any
good, anyways.

script/public-inbox-clone

index 5ecf11ae7d0926cfd06d63df1ede5008761ff71e..c7131d2642abd785103e9237b36eb3b96f5b9840 100755 (executable)
@@ -54,9 +54,8 @@ require PublicInbox::LeiMirror;
 $url = PublicInbox::LeiExternal::ext_canonicalize($url);
 my $lei = bless {
        env => \%ENV, opt => $opt, cmd => 'public-inbox-clone',
-       0 => \*STDIN, 2 => \*STDERR,
+       0 => \*STDIN, 1 => \*STDOUT, 2 => \*STDERR,
 }, 'PublicInbox::LEI';
-open $lei->{1}, '+<&=', 1 or die "dup: $!";
 open $lei->{3}, '.' or die "open . $!";
 my $mrr = bless {
        lei => $lei,