summaryrefslogtreecommitdiffstats
path: root/scd
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2016-12-30 07:17:50 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2016-12-30 07:17:50 +0100
commit337690441fcb19343fe56b139f5649bed7d25c83 (patch)
tree36e486ca70b00189c4ecae23aba5955e2cb1133d /scd
parentscd: Fix card removal monitor. (diff)
downloadgnupg2-337690441fcb19343fe56b139f5649bed7d25c83.tar.xz
gnupg2-337690441fcb19343fe56b139f5649bed7d25c83.zip
scd: Fix select_application.
* scd/app.c (select_application): Fix the condition for open. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'scd')
-rw-r--r--scd/app.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/scd/app.c b/scd/app.c
index 39910d2f9..a49972433 100644
--- a/scd/app.c
+++ b/scd/app.c
@@ -325,11 +325,11 @@ select_application (ctrl_t ctrl, const char *name, app_t *r_app, int scan)
*r_app = NULL;
- if (scan
+ if ((scan && !app_top)
/* FIXME: Here, we can change code to support multiple readers.
For now, we only open a single reader.
*/
- && !app_top)
+ || !app_top)
{
slot = apdu_open_reader (opt.reader_port);
if (slot >= 0)
@@ -374,6 +374,8 @@ select_application (ctrl_t ctrl, const char *name, app_t *r_app, int scan)
}
unlock_app (app);
}
+ else
+ err = gpg_error (GPG_ERR_ENODEV);
return err;
}