aboutsummaryrefslogtreecommitdiffstats
path: root/agent/call-scd.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--agent/call-scd.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/agent/call-scd.c b/agent/call-scd.c
index 8b79e81cf..5f7de0578 100644
--- a/agent/call-scd.c
+++ b/agent/call-scd.c
@@ -156,6 +156,8 @@ start_scd (void)
const char *pgmname;
ASSUAN_CONTEXT ctx;
const char *argv[3];
+ int no_close_list[3];
+ int i;
#ifdef USE_GNU_PTH
if (!pth_mutex_acquire (&scd_lock, 0, NULL))
@@ -191,8 +193,18 @@ start_scd (void)
argv[1] = "--server";
argv[2] = NULL;
+ i=0;
+ if (!opt.running_detached)
+ {
+ 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 pinentry and perform initial handshaking */
- rc = assuan_pipe_connect (&ctx, opt.scdaemon_program, (char**)argv, 0);
+ rc = assuan_pipe_connect (&ctx, opt.scdaemon_program, (char**)argv,
+ no_close_list);
if (rc)
{
log_error ("can't connect to the SCdaemon: %s\n",