From 2803499a7028b8c9869dd3ebc62fb618e973f87d Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 25 May 2011 06:51:04 +0300 Subject: [PATCH] Don't fill log files with repeating messages (#657658, #707412) "rv=0x... for client" and "Card Not Inserted" should be DEBUG log level, not ERROR. --- pcsc-lite-1.7.2-loglevel.patch | 24 ++++++++++++++++++++++++ pcsc-lite.spec | 9 ++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 pcsc-lite-1.7.2-loglevel.patch diff --git a/pcsc-lite-1.7.2-loglevel.patch b/pcsc-lite-1.7.2-loglevel.patch new file mode 100644 index 0000000..7682e47 --- /dev/null +++ b/pcsc-lite-1.7.2-loglevel.patch @@ -0,0 +1,24 @@ +diff -up pcsc-lite-1.7.2/src/winscard.c.loglevel pcsc-lite-1.7.2/src/winscard.c +--- pcsc-lite-1.7.2/src/winscard.c.loglevel 2011-02-02 15:43:35.000000000 +0200 ++++ pcsc-lite-1.7.2/src/winscard.c 2011-05-25 06:41:21.012756755 +0300 +@@ -287,7 +287,7 @@ LONG SCardConnect(/*@unused@*/ SCARDCONT + { + if (!(readerState & SCARD_PRESENT)) + { +- Log1(PCSC_LOG_ERROR, "Card Not Inserted"); ++ Log1(PCSC_LOG_DEBUG, "Card Not Inserted"); + return SCARD_E_NO_SMARTCARD; + } + +diff -up pcsc-lite-1.7.2/src/winscard_svc.c.loglevel pcsc-lite-1.7.2/src/winscard_svc.c +--- pcsc-lite-1.7.2/src/winscard_svc.c.loglevel 2011-01-29 15:50:59.000000000 +0200 ++++ pcsc-lite-1.7.2/src/winscard_svc.c 2011-05-25 06:41:21.011756744 +0300 +@@ -285,7 +285,7 @@ static const char *CommandsText[] = { + #define WRITE_BODY(v) \ + WRITE_BODY_WITH_COMMAND(CommandsText[header.command], v) + #define WRITE_BODY_WITH_COMMAND(command, v) \ +- Log4(SCARD_S_SUCCESS == v.rv ? PCSC_LOG_DEBUG : PCSC_LOG_ERROR, "%s rv=0x%X for client %d", command, v.rv, filedes); \ ++ Log4(PCSC_LOG_DEBUG, "%s rv=0x%X for client %d", command, v.rv, filedes); \ + ret = MessageSend(&v, sizeof(v), filedes); + + static void ContextThread(LPVOID newContext) diff --git a/pcsc-lite.spec b/pcsc-lite.spec index f4faaae..f181c3d 100644 --- a/pcsc-lite.spec +++ b/pcsc-lite.spec @@ -2,7 +2,7 @@ Name: pcsc-lite Version: 1.7.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: PC/SC Lite smart card framework and applications Group: System Environment/Daemons @@ -16,6 +16,9 @@ Patch1: %{name}-1.5.5-rpath64.patch Patch2: %{name}-1.6.7-noautostart.patch # Disable automatic card power down which seems to be unreliable at this point Patch3: %{name}-1.6.6-no_auto_power_down +# Avoid filling log files with "rv=0x... for client" and "Card Not Inserted" +# messages (#657658, #707412) +Patch4: pcsc-lite-1.7.2-loglevel.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libudev-devel @@ -68,6 +71,7 @@ Requires: %{name}-libs = %{version}-%{release} %patch0 -p0 -b .docinst %patch1 -p1 -b .rpath64 %patch2 -p1 -b .noautostart +%patch4 -p1 -b .loglevel # Convert to utf-8 for file in ChangeLog; do @@ -150,6 +154,9 @@ fi %changelog +* Wed May 25 2011 Kalev Lember - 1.7.2-2 +- Don't fill log files with repeating messages (#657658, #707412) + * Thu Mar 31 2011 Kalev Lember - 1.7.2-1 - Update to 1.7.2