Skip to content

Commit

Permalink
Make the code_status build_erlang_erts_c_compiler_version value more …
Browse files Browse the repository at this point in the history
…dependable.
  • Loading branch information
okeuday committed Aug 5, 2018
1 parent c15e641 commit ebd977e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/cloudi_core/src/cloudi_environment.erl
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,18 @@ status_file_time(FilePath) ->

erts_c_compiler_version() ->
case erlang:system_info(c_compiler_used) of
{undefined, _} ->
"";
{Name, undefined}
when is_atom(Name) ->
erlang:atom_to_list(Name);
{Name, V}
when is_atom(Name), is_tuple(V) ->
[_ | Version] = lists:flatten([[$., erlang:integer_to_list(I)]
[_ | Version] = lists:flatten([[$., io_lib:format("~p", [I])]
|| I <- erlang:tuple_to_list(V)]),
erlang:atom_to_list(Name) ++ [$ | Version];
{Name, Version} ->
cloudi_string:format("~p ~p", [Name, Version]);
Unexpected ->
?LOG_ERROR("erlang:system_info(c_compiler_used) invalid: ~p",
[Unexpected]),
Expand Down

0 comments on commit ebd977e

Please sign in to comment.