From e80316cf9a1a6f1e67bf32675f491481699547c7 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 4 May 2020 17:32:55 +0200 Subject: [PATCH] Silence SCARD_E_TIMEOUT warnings These occur quite often for status calls, so reduce log verbosity. --- channels/smartcard/client/smartcard_operations.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/channels/smartcard/client/smartcard_operations.c b/channels/smartcard/client/smartcard_operations.c index d1562b91e..16cd0c85d 100644 --- a/channels/smartcard/client/smartcard_operations.c +++ b/channels/smartcard/client/smartcard_operations.c @@ -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; }