diff options
author | Luis Rascao <[email protected]> | 2015-12-13 17:38:46 +0000 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-01-29 10:26:32 +0100 |
commit | 901b9703c898be4e6fd5a797a4b304bccafeee4b (patch) | |
tree | 3263d90955eb3a6f601d10f967e7fd34f5aae784 /lib | |
parent | 6945881b99aeadaf9ed4ec1f8c7811538cee1405 (diff) | |
download | otp-901b9703c898be4e6fd5a797a4b304bccafeee4b.tar.gz otp-901b9703c898be4e6fd5a797a4b304bccafeee4b.tar.bz2 otp-901b9703c898be4e6fd5a797a4b304bccafeee4b.zip |
Check for already started beam_lib crypto server
When starting the beam_lib crypto server, don't crash
when it is already running. Some other process might
have already called it.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/stdlib/src/beam_lib.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/stdlib/src/beam_lib.erl b/lib/stdlib/src/beam_lib.erl index cbbab088f4..503a2b416f 100644 --- a/lib/stdlib/src/beam_lib.erl +++ b/lib/stdlib/src/beam_lib.erl @@ -931,7 +931,10 @@ call_crypto_server(Req) -> end. call_crypto_server_1(Req) -> - {ok, _} = gen_server:start({local,?CRYPTO_KEY_SERVER}, ?MODULE, [], []), + case gen_server:start({local,?CRYPTO_KEY_SERVER}, ?MODULE, [], []) of + {ok, _} -> ok; + {error, {already_started, _}} -> ok + end, erlang:yield(), call_crypto_server(Req). |