diff options
Diffstat (limited to '')
-rw-r--r-- | sm/call-agent.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sm/call-agent.c b/sm/call-agent.c index f4b6087e2..b3c78579c 100644 --- a/sm/call-agent.c +++ b/sm/call-agent.c @@ -151,6 +151,8 @@ start_agent (void) { const char *pgmname; const char *argv[3]; + int no_close_list[3]; + int i; if (opt.verbose) log_info (_("no running gpg-agent - starting one\n")); @@ -172,8 +174,15 @@ start_agent (void) argv[1] = "--server"; argv[2] = NULL; + i=0; + if (log_get_fd () != -1) + no_close_list[i++] = log_get_fd (); + no_close_list[i++] = fileno (stderr); + no_close_list[i] = -1; + /* connect to the agent and perform initial handshaking */ - rc = assuan_pipe_connect (&ctx, opt.agent_program, (char**)argv, 0); + rc = assuan_pipe_connect (&ctx, opt.agent_program, (char**)argv, + no_close_list); } else { |