* [PATCH] t/httpd-corner: avoid clobbering existing FDs after fork
@ 2016-03-05 7:38 7% ` Eric Wong
0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2016-03-05 7:38 UTC (permalink / raw)
To: meta
Due to the deterministic way reference counting works,
we do not want to drop references to existing FDs
even if we no longer need the glob reference; the actual
FD is all we can pass through on exec.
---
t/httpd-corner.t | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/httpd-corner.t b/t/httpd-corner.t
index a6238e4..833eb42 100644
--- a/t/httpd-corner.t
+++ b/t/httpd-corner.t
@@ -55,10 +55,10 @@ my $spawn_httpd = sub {
# pretend to be systemd
dup2(fileno($sock), 3) or die "dup2 failed: $!\n";
dup2(fileno($unix), 4) or die "dup2 failed: $!\n";
- $sock = IO::Handle->new_from_fd(3, 'r');
- $sock->fcntl(F_SETFD, 0);
- $unix = IO::Handle->new_from_fd(4, 'r');
- $unix->fcntl(F_SETFD, 0);
+ my $t = IO::Handle->new_from_fd(3, 'r');
+ $t->fcntl(F_SETFD, 0);
+ my $u = IO::Handle->new_from_fd(4, 'r');
+ $u->fcntl(F_SETFD, 0);
$ENV{LISTEN_PID} = $$;
$ENV{LISTEN_FDS} = 2;
exec $httpd, @args, "--stdout=$out", "--stderr=$err", $psgi;
--
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 --
2016-03-03 10:33 [PATCH] daemon: support listening on Unix domain sockets Eric Wong
2016-03-04 0:43 ` [PATCH v2] " Eric Wong
2016-03-05 7:38 7% ` [PATCH] t/httpd-corner: avoid clobbering existing FDs after fork 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).