1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

* cardglue.c (card_close): New.

* ccid-driver.c (ccid_close_reader): New.
* apdu.c (close_ccid_reader, close_ct_reader, close_csc_reader)
(close_osc_reader, apdu_close_reader): New.  Not all are properly
implemented yet.
* g10.c (g10_exit): Use close_card.
This commit is contained in:
Werner Koch 2003-10-10 15:12:02 +00:00
parent 547b00c9ff
commit 5a0fbad9b3
8 changed files with 139 additions and 12 deletions

View file

@ -249,7 +249,7 @@ open_card (void)
int rc;
APP app;
current_app = NULL;/* FIXME: Release it first.*/
card_close ();
slot = apdu_open_reader (default_reader_port);
if (slot == -1)
{
@ -262,7 +262,7 @@ open_card (void)
rc = app_select_openpgp (app, &app->serialno, &app->serialnolen);
if (rc)
{
/* apdu_close_reader (slot); */
apdu_close_reader (slot);
log_info ("selecting openpgp failed: %s\n", gpg_strerror (rc));
xfree (app);
return NULL;
@ -273,6 +273,18 @@ open_card (void)
return app;
}
void
card_close (void)
{
if (current_app)
{
APP app = current_app;
current_app = NULL;
apdu_close_reader (app->slot);
xfree (app);
}
}
/* Return a new malloced string by unescaping the string S. Escaping