diff options
Diffstat (limited to 'lib/mnesia/src/mnesia_schema.erl')
-rw-r--r-- | lib/mnesia/src/mnesia_schema.erl | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/mnesia/src/mnesia_schema.erl b/lib/mnesia/src/mnesia_schema.erl index b0d7965886..f71ee26d7c 100644 --- a/lib/mnesia/src/mnesia_schema.erl +++ b/lib/mnesia/src/mnesia_schema.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2016. All Rights Reserved. +%% Copyright Ericsson AB 1996-2017. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -866,18 +866,18 @@ list2cs(List, ExtTypes) when is_list(List) -> is_list(DetsOpts) orelse mnesia:abort({badarg, Name, {dets, DetsOpts}}), [CheckProp(Prop, BadDetsOpts) || Prop <- DetsOpts], - case lists:keymember(mnesia, 1, application:which_applications()) of - true -> - Keys = check_keys(Name, List), - check_duplicates(Name, Keys); - false -> + case whereis(mnesia_controller) of + undefined -> %% check_keys/2 cannot be executed when mnesia is not %% running, due to it not being possible to read what ext %% backends are loaded. - %%% this doesn't work - disabled for now: - %%%Keys = check_keys(Name, List, record_info(fields, cstruct)), - %%%check_duplicates(Name, Keys) - ignore + %% this doesn't work - disabled for now: + %%Keys = check_keys(Name, List, record_info(fields, cstruct)), + %%check_duplicates(Name, Keys) + ignore; + Pid when is_pid(Pid) -> + Keys = check_keys(Name, List), + check_duplicates(Name, Keys) end, Cs0 = #cstruct{name = Name, |