From 0fa8ab4a0213340b5e7868469427fdde5bc5106a Mon Sep 17 00:00:00 2001 From: Kresten Krab Thorup Date: Wed, 26 Nov 2014 13:21:53 +0100 Subject: [PATCH] Fix up the ensure_started code --- src/hanoidb.erl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/hanoidb.erl b/src/hanoidb.erl index 4e88a62..94413f9 100644 --- a/src/hanoidb.erl +++ b/src/hanoidb.erl @@ -448,9 +448,12 @@ do_transact(TransactionSpec, State=#state{ nursery=Nursery, top=Top }) -> {ok, State#state{ nursery=Nursery2 }}. start_app() -> - application:start(syntax_tools), - application:start(plain_fsm), - case application:start(?MODULE) of + ok = ensure_started(syntax_tools), + ok = ensure_started(plain_fsm), + ok = ensure_started(?MODULE). + +ensure_started(Application) -> + case application:start(Application) of ok -> ok; {error, {already_started, _}} ->