* [PATCH] daemon: simplify socket inheriting, slightly
@ 2016-03-04 1:07 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2016-03-04 1:07 UTC (permalink / raw)
To: meta
IO::Handle->new_from_fd has existed since at least 1996,
so it should be safe to depend on at this point.
---
lib/PublicInbox/Daemon.pm | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm
index 9f33c05..f0be034 100644
--- a/lib/PublicInbox/Daemon.pm
+++ b/lib/PublicInbox/Daemon.pm
@@ -206,8 +206,7 @@ sub inherit () {
my $end = $fds + 2; # LISTEN_FDS_START - 1
my @rv = ();
foreach my $fd (3..$end) {
- my $s = IO::Handle->new;
- $s->fdopen($fd, 'r');
+ my $s = IO::Handle->new_from_fd($fd, 'r');
if (my $k = sockname($s)) {
$listener_names{$k} = $s;
push @rv, $s;
--
EW
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-03-04 1:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-04 1:07 [PATCH] daemon: simplify socket inheriting, slightly 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).