Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions lib/kernel/src/inet_db.erl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
-module(inet_db).
-moduledoc false.

-compile(nowarn_deprecated_catch).

%% Store info about ip addresses, names, aliases host files resolver
%% options.
%% Also miscellaneous "stuff" related to sockets.
Expand Down Expand Up @@ -285,13 +283,12 @@ add_rc(File) ->
Error -> Error
end.

%% Add an inetrc binary term must be a rc list
%% Add an inetrc binary term that must be an rc list
add_rc_bin(Bin) ->
case catch binary_to_term(Bin) of
List when is_list(List) ->
add_rc_list(List);
_ ->
{error, badarg}
try binary_to_term(Bin) of
List when is_list(List) -> add_rc_list(List);
_ -> {error, badarg}
catch error : _ -> {error, badarg}
end.

add_rc_list(List) -> call({add_rc_list, List}).
Expand Down
Loading