aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kernel/src')
-rw-r--r--lib/kernel/src/inet.erl9
-rw-r--r--lib/kernel/src/inet_parse.erl4
-rw-r--r--lib/kernel/src/rpc.erl2
-rw-r--r--lib/kernel/src/user_drv.erl2
4 files changed, 13 insertions, 4 deletions
diff --git a/lib/kernel/src/inet.erl b/lib/kernel/src/inet.erl
index 3ea530a366..5749027acd 100644
--- a/lib/kernel/src/inet.erl
+++ b/lib/kernel/src/inet.erl
@@ -32,7 +32,7 @@
ip/1, stats/0, options/0,
pushf/3, popf/1, close/1, gethostname/0, gethostname/1,
parse_ipv4_address/1, parse_ipv6_address/1, parse_ipv4strict_address/1,
- parse_ipv6strict_address/1, parse_address/1, parse_strict_address/1]).
+ parse_ipv6strict_address/1, parse_address/1, parse_strict_address/1, ntoa/1]).
-export([connect_options/2, listen_options/2, udp_options/2, sctp_options/2]).
@@ -529,6 +529,13 @@ getservbyname(Name, Protocol) when is_atom(Name) ->
Error -> Error
end.
+-spec ntoa(IpAddress) ->
+ {ok, Address} | {error, einval} when
+ Address :: string(),
+ IpAddress :: ip_address().
+ntoa(Addr) ->
+ inet_parse:ntoa(Addr).
+
-spec parse_ipv4_address(Address) ->
{ok, IPv4Address} | {error, einval} when
Address :: string(),
diff --git a/lib/kernel/src/inet_parse.erl b/lib/kernel/src/inet_parse.erl
index 619c78a6ca..98bd8d386c 100644
--- a/lib/kernel/src/inet_parse.erl
+++ b/lib/kernel/src/inet_parse.erl
@@ -722,7 +722,9 @@ ntoa({0,0,0,0,0,16#ffff,A,B}) ->
"::FFFF:" ++ dig_to_dec(A) ++ "." ++ dig_to_dec(B);
ntoa({_,_,_,_,_,_,_,_}=T) ->
%% Find longest sequence of zeros, at least 2, to replace with "::"
- ntoa(tuple_to_list(T), []).
+ ntoa(tuple_to_list(T), []);
+ntoa(_) ->
+ {error, einval}.
%% Find first double zero
ntoa([], R) ->
diff --git a/lib/kernel/src/rpc.erl b/lib/kernel/src/rpc.erl
index ced6f47bfe..0e7e7d2031 100644
--- a/lib/kernel/src/rpc.erl
+++ b/lib/kernel/src/rpc.erl
@@ -407,7 +407,7 @@ cast(Node, Mod, Fun, Args) ->
true.
-%% Asynchronous broadcast, returns nothing, it's just send'n prey
+%% Asynchronous broadcast, returns nothing, it's just send 'n' pray
-spec abcast(Name, Msg) -> abcast when
Name :: atom(),
Msg :: term().
diff --git a/lib/kernel/src/user_drv.erl b/lib/kernel/src/user_drv.erl
index bb654495d3..7b4ffb09ca 100644
--- a/lib/kernel/src/user_drv.erl
+++ b/lib/kernel/src/user_drv.erl
@@ -418,7 +418,7 @@ list_commands(Iport, Oport) ->
true ->
[];
false ->
- [{put_chars,unicode," q - quit erlang\n"}]
+ [{put_chars, unicode," q - quit erlang\n"}]
end,
io_requests([{put_chars, unicode," c [nn] - connect to job\n"},
{put_chars, unicode," i [nn] - interrupt job\n"},