agent: Fix detection of exit of scdaemon.
authorNIIBE Yutaka <gniibe@fsij.org>
Wed, 6 Mar 2019 01:33:54 +0000 (10:33 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Wed, 6 Mar 2019 02:00:10 +0000 (11:00 +0900)
commit2abad7585a004586e27ead6ab8c9c57ce5ed1326
treefc75eeaa5bdf123eb912e9c16e35e03f6d233f74
parent8d4af54ddd039d47e9c4803559193fcca97f0a46
agent: Fix detection of exit of scdaemon.

* agent/call-scd.c (start_scd): Acquire START_SCD_LOCK for
SCD_LOCAL_LIST.  Move common case code to fast path.
Release START_SCD_LOCK before calling unlock_scd.
When new CTX is allocated, clear INVALID flag.
(agent_reset_scd): Serialize the access to SCD_LOCAL_LIST by
START_SCD_LOCK.

--

GnuPG-bug-id: 4377
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
agent/call-scd.c