diff options
Diffstat (limited to 'agent')
-rw-r--r-- | agent/ChangeLog | 5 | ||||
-rw-r--r-- | agent/call-scd.c | 13 |
2 files changed, 15 insertions, 3 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog index c3798c143..f45c6d7f3 100644 --- a/agent/ChangeLog +++ b/agent/ChangeLog @@ -1,3 +1,8 @@ +2008-10-15 Werner Koch <[email protected]> + + * call-scd.c (start_scd): Enable assuan loggging if requested. + (agent_scd_check_aliveness) [W32]: Fix use of GetExitCodeProcess. + 2008-10-14 Werner Koch <[email protected]> * gpg-agent.c (get_agent_scd_notify_event): Need to use a manual diff --git a/agent/call-scd.c b/agent/call-scd.c index 55f2d4ffb..65483e55d 100644 --- a/agent/call-scd.c +++ b/agent/call-scd.c @@ -343,6 +343,9 @@ start_scd (ctrl_t ctrl) if (opt.verbose) log_debug ("first connection to SCdaemon established\n"); + if (DBG_ASSUAN) + assuan_set_log_stream (ctx, log_get_stream ()); + /* Get the name of the additional socket opened by scdaemon. */ { membuf_t data; @@ -412,9 +415,10 @@ agent_scd_check_aliveness (void) { pth_event_t evt; pid_t pid; - int rc; #ifdef HAVE_W32_SYSTEM - DWORD dummyec; + DWORD rc; +#else + int rc; #endif if (!primary_scd_ctx) @@ -443,8 +447,11 @@ agent_scd_check_aliveness (void) { pid = assuan_get_pid (primary_scd_ctx); #ifdef HAVE_W32_SYSTEM + /* If we have a PID we disconnect if either GetExitProcessCode + fails or if ir returns the exit code of the scdaemon. 259 is + the error code for STILL_ALIVE. */ if (pid != (pid_t)(void*)(-1) && pid - && !GetExitCodeProcess ((HANDLE)pid, &dummyec)) + && (!GetExitCodeProcess ((HANDLE)pid, &rc) || rc != 259)) #else if (pid != (pid_t)(-1) && pid && ((rc=waitpid (pid, NULL, WNOHANG))==-1 || (rc == pid)) ) |