2008-10-21 Marcus Brinkmann <marcus@g10code.com>

* command.c (open_card): If connect error is SW_HOST_NO_CARD,
	return a more descriptive error.
This commit is contained in:
Marcus Brinkmann 2008-10-21 13:53:08 +00:00
parent 0a5f742466
commit b04901468f
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-10-21 Marcus Brinkmann <marcus@g10code.com>
* command.c (open_card): If connect error is SW_HOST_NO_CARD,
return a more descriptive error.
2008-10-20 Werner Koch <wk@g10code.com>
* pcsc-wrapper.c (read_32): Use provided arg and not stdin. Is

View File

@ -405,7 +405,12 @@ open_card (ctrl_t ctrl, const char *apptype)
select_application. */
int sw = apdu_connect (slot);
if (sw && sw != SW_HOST_ALREADY_CONNECTED)
err = gpg_error (GPG_ERR_CARD);
{
if (sw == SW_HOST_NO_CARD)
err = gpg_error (GPG_ERR_CARD_NOT_PRESENT);
else
err = gpg_error (GPG_ERR_CARD);
}
else
err = select_application (ctrl, slot, apptype, &ctrl->app_ctx);
}