diff options
author | Eric Wong <e@80x24.org> | 2016-03-05 22:42:16 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-03-05 22:42:38 +0000 |
commit | 2ea979f43ec87547b7dfb74312a21062044d018a (patch) | |
tree | 0e655223dc6f4359f136c8fc7633630c6c1d7422 /lib | |
parent | bc5f141e8e4e4df3813dd123cf5a76355e65be17 (diff) | |
download | public-inbox-2ea979f43ec87547b7dfb74312a21062044d018a.tar.gz |
This means we can avoid false-positives when inheriting multiple Unix domain sockets.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/Daemon.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index 51562624..a6707e83 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -185,6 +185,10 @@ sub sockname ($) { my ($s) = @_; my $addr = getsockname($s) or return; my ($host, $port) = host_with_port($addr); + if ($port == 0 && $host eq '127.0.0.1') { + my ($path) = Socket::sockaddr_un($addr); + return $path; + } "$host:$port"; } |