Skip to content

Commit

Permalink
Improved NIF initialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
davisp committed Jun 13, 2011
1 parent 5846159 commit f94c7af
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/jiffy.erl
Expand Up @@ -79,18 +79,15 @@ finish_encode(_, _) ->




init() -> init() ->
SoName = case code:priv_dir(?MODULE) of PrivDir = case code:priv_dir(?MODULE) of
{error, bad_name} -> {error, _} ->
case filelib:is_dir(filename:join(["..", priv])) of EbinDir = filename:dirname(code:which(?MODULE)),
true -> AppPath = filename:dirname(EbinDir),
filename:join(["..", priv, ?MODULE]); filename:join(AppPath, "priv");
_ -> Path ->
filename:join([priv, ?MODULE]) Path
end;
Dir ->
filename:join(Dir, ?MODULE)
end, end,
erlang:load_nif(SoName, 0). erlang:load_nif(filename:join(PrivDir, "jiffy"), 0).




not_loaded(Line) -> not_loaded(Line) ->
Expand Down

0 comments on commit f94c7af

Please sign in to comment.