From ee13fe6970000bfa9b0340cc41f98361217a0a2f Mon Sep 17 00:00:00 2001 From: Alexey Romanov Date: Mon, 6 Dec 2010 19:14:32 +0300 Subject: [PATCH] Remove error messages about driver being permanent --- src/sqlite3.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sqlite3.erl b/src/sqlite3.erl index e7a52ac..e24ee76 100644 --- a/src/sqlite3.erl +++ b/src/sqlite3.erl @@ -539,6 +539,9 @@ init(Options) -> ok -> Port = open_port({spawn, create_port_cmd(DbFile)}, [binary]), {ok, #state{port = Port, ops = Options}}; + {error, permanent} -> %% already loaded! + Port = open_port({spawn, create_port_cmd(DbFile)}, [binary]), + {ok, #state{port = Port, ops = Options}}; {error, Error} -> Msg = io_lib:format("Error loading ~p: ~s", [?DRIVER_NAME, erl_ddll:format_error(Error)]), @@ -683,10 +686,13 @@ terminate(_Reason, #state{port = Port}) -> case erl_ddll:unload(?DRIVER_NAME) of ok -> ok; + {error, permanent} -> + ok; %% FIXME is this the correct behavior? {error, ErrorDesc} -> error_logger:error_msg("Error unloading sqlite3 driver: ~s~n", [erl_ddll:format_error(ErrorDesc)]) - end. + end, + ok. %%-------------------------------------------------------------------- %% Func: code_change(OldVsn, State, Extra) -> {ok, NewState}