- suppress "not supported" error messages from sc_card_ctl

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1004 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
okir 2003-04-14 08:17:53 +00:00
parent d2b5c08857
commit 91b7b3c7a6
2 changed files with 9 additions and 5 deletions

View File

@ -1685,7 +1685,6 @@ gpk_card_ctl(struct sc_card *card, unsigned long cmd, void *ptr)
*(int *) ptr = DRVDATA(card)->locked;
return 0;
}
error(card->ctx, "card_ctl command %u not supported\n", cmd);
return SC_ERROR_NOT_SUPPORTED;
}

View File

@ -745,13 +745,18 @@ inline int sc_card_valid(const struct sc_card *card) {
int
sc_card_ctl(struct sc_card *card, unsigned long cmd, void *args)
{
int r;
int r = SC_ERROR_NOT_SUPPORTED;
assert(card != NULL);
SC_FUNC_CALLED(card->ctx, 2);
if (card->ops->card_ctl == NULL)
SC_FUNC_RETURN(card->ctx, 2, SC_ERROR_NOT_SUPPORTED);
r = card->ops->card_ctl(card, cmd, args);
if (card->ops->card_ctl != NULL)
r = card->ops->card_ctl(card, cmd, args);
/* suppress "not supported" error messages */
if (r == SC_ERROR_NOT_SUPPORTED) {
debug(card->ctx, "card_ctl(%lu) not supported\n", cmd);
return r;
}
SC_FUNC_RETURN(card->ctx, 2, r);
}