Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Find the chroot and priv directories

  • Loading branch information...
commit 94817d2a3497f92fc2654a9eed038048a40e7874 1 parent a08a6b6
@msantos authored
Showing with 15 additions and 2 deletions.
  1. +15 −2 src/epcap.erl
View
17 src/epcap.erl
@@ -145,8 +145,21 @@ get_switch({user, Arg}) -> "-u " ++ Arg;
get_switch({verbose, Arg}) -> string:copies("-v ", Arg);
get_switch({filter, Arg}) -> "\"" ++ Arg ++ "\"".
+basedir() ->
+ case code:priv_dir(?MODULE) of
+ {error,bad_name} ->
+ filename:join([
+ filename:dirname(code:which(?MODULE)),
+ "..",
+ "priv",
+ ?MODULE
+ ]);
+ _ ->
+ code:priv_dir(?MODULE)
+ end.
+
progname() ->
- filename:join([code:lib_dir(epcap,priv),?MODULE]).
+ filename:join([basedir(), ?MODULE]).
chroot_path() ->
- filename:join([code:lib_dir(epcap,priv),"tmp"]).
+ filename:join([basedir(), "tmp"]).
Please sign in to comment.
Something went wrong with that request. Please try again.