* [PATCH] GitCatFile: remove unnecessary FD_CLOEXEC setting
@ 2015-08-28 0:50 7% Eric Wong
0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2015-08-28 0:50 UTC (permalink / raw)
To: meta
Unless some idiot raises $^F, we should not have to care about
the close-on-exec flag. Everything since Perl 3.0 seems to set
it by default, and 5.6 got more consistent about it.
---
lib/PublicInbox/GitCatFile.pm | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/lib/PublicInbox/GitCatFile.pm b/lib/PublicInbox/GitCatFile.pm
index 9bffce2..142491e 100644
--- a/lib/PublicInbox/GitCatFile.pm
+++ b/lib/PublicInbox/GitCatFile.pm
@@ -6,7 +6,6 @@
package PublicInbox::GitCatFile;
use strict;
use warnings;
-use Fcntl qw(F_GETFD F_SETFD FD_CLOEXEC);
use POSIX qw(dup2);
sub new {
@@ -14,21 +13,13 @@ sub new {
bless { git_dir => $git_dir }, $class;
}
-sub set_cloexec {
- my ($fh) = @_;
- my $flags = fcntl($fh, F_GETFD, 0) or die "fcntl(F_GETFD): $!\n";
- fcntl($fh, F_SETFD, $flags | FD_CLOEXEC) or die "fcntl(F_SETFD): $!\n";
-}
-
sub _cat_file_begin {
my ($self) = @_;
return if $self->{pid};
my ($in_r, $in_w, $out_r, $out_w);
pipe($in_r, $in_w) or die "pipe failed: $!\n";
- set_cloexec($_) foreach ($in_r, $in_w);
pipe($out_r, $out_w) or die "pipe failed: $!\n";
- set_cloexec($_) foreach ($out_r, $out_w);
my @cmd = ('git', "--git-dir=$self->{git_dir}", qw(cat-file --batch));
my $pid = fork;
--
EW
^ permalink raw reply related [relevance 7%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-08-28 0:50 7% [PATCH] GitCatFile: remove unnecessary FD_CLOEXEC setting Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).