mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
scd: When reader is specified, make sure only open once.
* scd/apdu.c (apdu_open_reader): Make sure not to try multiple times, when PORTSTR is specified. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
8d81fd7c01
commit
d6fe82d3d1
@ -2142,6 +2142,11 @@ apdu_open_reader (struct dev_list *dl)
|
||||
if (readerno < 0 || readerno >= dl->idx_max)
|
||||
return -1;
|
||||
|
||||
/* If already opened HANDLE, return -1. */
|
||||
for (slot = 0; slot < MAX_READER; slot++)
|
||||
if (reader_table[slot].used)
|
||||
return -1;
|
||||
|
||||
dl->idx = readerno;
|
||||
dl->portstr = NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user