diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2017-01-06 02:35:46 +0100 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2017-01-06 02:35:46 +0100 |
commit | 858e14cd794e2a6125d51e652a754bbe26def997 (patch) | |
tree | bac534c8508917d46fc048fe9268d05bd97b1a56 /scd/apdu.c | |
parent | scd: Fix for --disable-ccid-driver. (diff) | |
download | gnupg2-858e14cd794e2a6125d51e652a754bbe26def997.tar.xz gnupg2-858e14cd794e2a6125d51e652a754bbe26def997.zip |
scd: Fix for --disable-ccid for scdaemon.
* scd/apdu.c (apdu_dev_list_finish): Don't call ccid_dev_scan_finish
with no table.
(apdu_open_reader): Only increment when it's zero.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'scd/apdu.c')
-rw-r--r-- | scd/apdu.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/scd/apdu.c b/scd/apdu.c index db46c4dfe..38ebd2be5 100644 --- a/scd/apdu.c +++ b/scd/apdu.c @@ -2974,7 +2974,8 @@ void apdu_dev_list_finish (struct dev_list *dl) { #ifdef HAVE_LIBUSB - ccid_dev_scan_finish (dl->ccid_table, dl->idx_max); + if (dl->ccid_table) + ccid_dev_scan_finish (dl->ccid_table, dl->idx_max); #endif xfree (dl); npth_mutex_unlock (&reader_table_lock); @@ -3195,15 +3196,15 @@ apdu_open_reader (struct dev_list *dl) else #endif { /* PC/SC readers. */ - if (dl->idx++ == 0) - slot = apdu_open_one_reader (dl->portstr); + if (dl->idx == 0) + { + dl->idx++; + slot = apdu_open_one_reader (dl->portstr); + } else slot = -1; } - if (DBG_READER) - log_debug ("leave: apdu_open_reader => slot=%d [ccid]\n", slot); - return slot; } |