Fix loading of the nif while on the console in develop dir.

This commit is contained in:
Maas-Maarten Zeeman
2012-12-26 13:01:49 +01:00
parent 661e417c90
commit 6d7591619b

View File

@@ -35,7 +35,11 @@
-on_load(init/0).
init() ->
ok = erlang:load_nif(code:priv_dir(esqlite) ++ "/esqlite3_nif", 0).
PrivDir = case code:priv_dir(esqlite) of
{error, bad_name} -> "./priv";
Dir -> Dir
end,
ok = erlang:load_nif(PrivDir ++ "/esqlite3_nif", 0).
%% @doc Start a low level thread which will can handle sqlite3 calls.
%%