Merge pull request #6140 from akallabeth/smartcard_silence

Silence SCARD_E_TIMEOUT warnings
This commit is contained in:
Bernhard Miklautz 2020-05-05 15:41:04 +02:00 committed by GitHub
commit ecc9f12733
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 2 deletions

View File

@ -42,8 +42,19 @@
static LONG log_status_error(const char* tag, const char* what, LONG status)
{
if (status != SCARD_S_SUCCESS)
WLog_ERR(tag, "%s failed with error %s [%" PRId32 "]", what, SCardGetErrorString(status),
status);
{
DWORD level = WLOG_ERROR;
switch (status)
{
case SCARD_E_TIMEOUT:
level = WLOG_DEBUG;
break;
default:
break;
}
WLog_Print(WLog_Get(tag), level, "%s failed with error %s [%" PRId32 "]", what,
SCardGetErrorString(status), status);
}
return status;
}