about summary refs log tree commit homepage
path: root/lib/PublicInbox/Daemon.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-03-05 22:42:16 +0000
committerEric Wong <e@80x24.org>2016-03-05 22:42:38 +0000
commit2ea979f43ec87547b7dfb74312a21062044d018a (patch)
tree0e655223dc6f4359f136c8fc7633630c6c1d7422 /lib/PublicInbox/Daemon.pm
parentbc5f141e8e4e4df3813dd123cf5a76355e65be17 (diff)
downloadpublic-inbox-2ea979f43ec87547b7dfb74312a21062044d018a.tar.gz
This means we can avoid false-positives when inheriting multiple
Unix domain sockets.
Diffstat (limited to 'lib/PublicInbox/Daemon.pm')
-rw-r--r--lib/PublicInbox/Daemon.pm4
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";
 }