summaryrefslogtreecommitdiff
path: root/p11p-daemon/src/p11p_remote.erl
diff options
context:
space:
mode:
Diffstat (limited to 'p11p-daemon/src/p11p_remote.erl')
-rw-r--r--p11p-daemon/src/p11p_remote.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/p11p-daemon/src/p11p_remote.erl b/p11p-daemon/src/p11p_remote.erl
index 1247f12..c6a1948 100644
--- a/p11p-daemon/src/p11p_remote.erl
+++ b/p11p-daemon/src/p11p_remote.erl
@@ -58,11 +58,16 @@ stop(Pid, Reason) ->
gen_server:cast(Pid, {stop, Reason}).
%% Genserver callbacks.
-init([TokName, ModPath]) ->
+init([TokName, ModPath, ModEnv]) ->
RemoteBinPath = p11p_config:remotebin_path(),
Port = open_port({spawn_executable, RemoteBinPath},
- [stream, exit_status, {args, [ModPath, "-v"]}]),
+ [stream,
+ exit_status,
+ {env, ModEnv},
+ {args, [ModPath, "-v"]} % FIXME: Remove -v
+ ]),
lager:debug("~p: ~s: new remote port: ~p", [self(), RemoteBinPath, Port]),
+ lager:debug("~p: ~s: module: ~s, env: ~p", [self(), RemoteBinPath, ModPath, ModEnv]),
{ok, #state{port = Port, token = TokName}}.
handle_call({add_to_outbuf, Data}, _From, State) ->