fixed error handling if no card found

This commit is contained in:
Frank Morgner
2015-03-13 21:16:03 +01:00
parent e52a9a5bbc
commit f5e319be68

View File

@@ -116,8 +116,13 @@ static int pcsc_connect(driver_data_t **driver_data)
} }
} }
if (readerslen <= 0) { if (readerslen <= 0) {
if (readernum == READERNUM_AUTODETECT) {
RELAY_ERROR("Could not find a reader with a card\n");
r = SCARD_E_NO_SMARTCARD;
} else {
RELAY_ERROR("Could not find reader number %u\n", readernum); RELAY_ERROR("Could not find reader number %u\n", readernum);
r = SCARD_E_UNKNOWN_READER; r = SCARD_E_UNKNOWN_READER;
}
goto err; goto err;
} }