mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
scd: Fix for --disable-ccid-driver.
* scd/apdu.c [HAVE_LIBUSB] (apdu_dev_list_start): Conditionalize. [HAVE_LIBUSB] (apdu_dev_list_finish, apdu_open_reader): Likewise. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
8a41e73c31
commit
62268a2732
@ -2919,7 +2919,6 @@ open_rapdu_reader (int portno,
|
|||||||
gpg_error_t
|
gpg_error_t
|
||||||
apdu_dev_list_start (const char *portstr, struct dev_list **l_p)
|
apdu_dev_list_start (const char *portstr, struct dev_list **l_p)
|
||||||
{
|
{
|
||||||
gpg_error_t err;
|
|
||||||
struct dev_list *dl = xtrymalloc (sizeof (struct dev_list));
|
struct dev_list *dl = xtrymalloc (sizeof (struct dev_list));
|
||||||
|
|
||||||
*l_p = NULL;
|
*l_p = NULL;
|
||||||
@ -2939,6 +2938,8 @@ apdu_dev_list_start (const char *portstr, struct dev_list **l_p)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
gpg_error_t err;
|
||||||
|
|
||||||
err = ccid_dev_scan (&dl->idx_max, &dl->ccid_table);
|
err = ccid_dev_scan (&dl->idx_max, &dl->ccid_table);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
@ -2972,7 +2973,9 @@ apdu_dev_list_start (const char *portstr, struct dev_list **l_p)
|
|||||||
void
|
void
|
||||||
apdu_dev_list_finish (struct dev_list *dl)
|
apdu_dev_list_finish (struct dev_list *dl)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_LIBUSB
|
||||||
ccid_dev_scan_finish (dl->ccid_table, dl->idx_max);
|
ccid_dev_scan_finish (dl->ccid_table, dl->idx_max);
|
||||||
|
#endif
|
||||||
xfree (dl);
|
xfree (dl);
|
||||||
npth_mutex_unlock (&reader_table_lock);
|
npth_mutex_unlock (&reader_table_lock);
|
||||||
}
|
}
|
||||||
@ -3117,6 +3120,7 @@ apdu_open_reader (struct dev_list *dl)
|
|||||||
{
|
{
|
||||||
int slot;
|
int slot;
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBUSB
|
||||||
if (dl->ccid_table)
|
if (dl->ccid_table)
|
||||||
{ /* CCID readers. */
|
{ /* CCID readers. */
|
||||||
int readerno;
|
int readerno;
|
||||||
@ -3189,6 +3193,7 @@ apdu_open_reader (struct dev_list *dl)
|
|||||||
slot = -1;
|
slot = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{ /* PC/SC readers. */
|
{ /* PC/SC readers. */
|
||||||
if (dl->idx++ == 0)
|
if (dl->idx++ == 0)
|
||||||
slot = apdu_open_one_reader (dl->portstr);
|
slot = apdu_open_one_reader (dl->portstr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user