From 2bb3ac3a7632e8f263ac0c7eebe23a5dcb2a6789 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Mon, 6 Jan 2020 16:32:21 +0100 Subject: WIP set environment for remotes --- p11p-daemon/src/p11p_remote.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'p11p-daemon/src/p11p_remote.erl') 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) -> -- cgit v1.1