diff options
author | NIIBE Yutaka <[email protected]> | 2012-06-12 05:51:52 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2012-06-12 05:51:52 +0000 |
commit | a3ae21162ae14a6a1661ef1a6937601f6914528b (patch) | |
tree | b6392a1986cfcc00f11490df8e4f40bbc6b890c9 | |
parent | scd: Fix the changes of scd/command.c (diff) | |
download | gnupg-a3ae21162ae14a6a1661ef1a6937601f6914528b.tar.gz gnupg-a3ae21162ae14a6a1661ef1a6937601f6914528b.zip |
scd fixes on error.
* scd/apdu.c (open_pcsc_reader_wrapped): Show error number.
* scd/command.c (get_reader_slot): Return -1 on error.
-rw-r--r-- | scd/apdu.c | 3 | ||||
-rw-r--r-- | scd/command.c | 13 |
2 files changed, 9 insertions, 7 deletions
diff --git a/scd/apdu.c b/scd/apdu.c index b8bfceca0..541dd05fa 100644 --- a/scd/apdu.c +++ b/scd/apdu.c @@ -1728,7 +1728,8 @@ open_pcsc_reader_wrapped (const char *portstr) | (msgbuf[7] << 8 ) | msgbuf[8]); 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);*/ goto command_failed; } diff --git a/scd/command.c b/scd/command.c index be0597718..5ef6540da 100644 --- a/scd/command.c +++ b/scd/command.c @@ -414,18 +414,19 @@ get_reader_slot (void) int no_service_flag; ss->slot = apdu_open_reader (opt.reader_port, &no_service_flag); + if (no_service_flag) + { + log_info ("no card services - disabling scdaemon\n"); + 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; } - - if (no_service_flag) - { - log_info ("no card services - disabling scdaemon\n"); - reader_disabled = 1; - } } /* Return the slot_table index. */ |