summaryrefslogtreecommitdiff
path: root/lib/kernel/src/inet.erl
diff options
context:
space:
mode:
authorMicael Karlberg <bmk@erlang.org>2021-07-09 18:26:12 +0200
committerMicael Karlberg <bmk@erlang.org>2021-07-29 12:50:18 +0200
commita481a7b70b9362c8dbd47e4519ceb8e94b27cfd2 (patch)
treebd5b398ebc51caeb32645f108073ddc91df4312b /lib/kernel/src/inet.erl
parentc2915a365fcded89895f0a93ca890dd08d3ec694 (diff)
downloaderlang-a481a7b70b9362c8dbd47e4519ceb8e94b27cfd2.tar.gz
[kernel] Add 'active' to info
Add 'active' to info for gen_tcp_socket and the old 'port' socket's. OTP-17410
Diffstat (limited to 'lib/kernel/src/inet.erl')
-rw-r--r--lib/kernel/src/inet.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/kernel/src/inet.erl b/lib/kernel/src/inet.erl
index 6350257835..6efa6f108c 100644
--- a/lib/kernel/src/inet.erl
+++ b/lib/kernel/src/inet.erl
@@ -679,7 +679,12 @@ info({'$inet', GenSocketMod, _} = Socket)
info(Socket) when is_port(Socket) ->
case port_info(Socket) of
#{states := _} = PortInfo ->
- PortInfo;
+ case inet:getopts(Socket, [active]) of
+ {ok, [{active, Active}]} ->
+ PortInfo#{active => Active};
+ _ ->
+ PortInfo
+ end;
PortInfo0 ->
%% Its actually possible to call this function for non-socket ports,
%% but in that case we have no status or statistics.