mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
scd fixes on error.
* scd/apdu.c (open_pcsc_reader_wrapped): Show error number. * scd/command.c (get_reader_slot): Return -1 on error.
This commit is contained in:
parent
c86e9bd1bc
commit
03be1a059b
@ -1728,7 +1728,8 @@ open_pcsc_reader_wrapped (const char *portstr)
|
|||||||
| (msgbuf[7] << 8 ) | msgbuf[8]);
|
| (msgbuf[7] << 8 ) | msgbuf[8]);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
log_error ("PC/SC OPEN failed: %s\n", pcsc_error_string (err));
|
log_error ("PC/SC OPEN failed: %s (0x%08x)\n",
|
||||||
|
pcsc_error_string (err), err);
|
||||||
/*sw = pcsc_error_to_sw (err);*/
|
/*sw = pcsc_error_to_sw (err);*/
|
||||||
goto command_failed;
|
goto command_failed;
|
||||||
}
|
}
|
||||||
|
@ -414,18 +414,19 @@ get_reader_slot (void)
|
|||||||
int no_service_flag;
|
int no_service_flag;
|
||||||
ss->slot = apdu_open_reader (opt.reader_port, &no_service_flag);
|
ss->slot = apdu_open_reader (opt.reader_port, &no_service_flag);
|
||||||
|
|
||||||
/* If we still don't have a slot, we have no readers.
|
|
||||||
Invalidate for now until a reader is attached. */
|
|
||||||
if(ss->slot == -1)
|
|
||||||
{
|
|
||||||
ss->valid = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (no_service_flag)
|
if (no_service_flag)
|
||||||
{
|
{
|
||||||
log_info ("no card services - disabling scdaemon\n");
|
log_info ("no card services - disabling scdaemon\n");
|
||||||
reader_disabled = 1;
|
reader_disabled = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we still don't have a slot, we have no readers.
|
||||||
|
Invalidate for now until a reader is attached. */
|
||||||
|
if(ss->slot == -1)
|
||||||
|
{
|
||||||
|
ss->valid = 0;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the slot_table index. */
|
/* Return the slot_table index. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user