[Pcsclite-git-commit] [PCSC] 01/03: Do not check RFUnInitializeReader() return value

Ludovic Rousseau rousseau at moszumanska.debian.org
Thu May 4 15:31:41 UTC 2017


This is an automated email from the git hooks/post-receive script.

rousseau pushed a commit to branch master
in repository PCSC.

commit 789dae8a8acf8d1693597159d7d590a96bdd6424
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Thu May 4 09:47:16 2017 +0200

    Do not check RFUnInitializeReader() return value
    
    RFUnInitializeReader() always returns SCARD_S_SUCCESS so it is useless
    to check the returned value.
    
    RFUnInitializeReader() now returns void instead.
---
 src/readerfactory.c | 10 +++-------
 src/readerfactory.h |  2 +-
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/readerfactory.c b/src/readerfactory.c
index 4f97892..d8f1ee1 100644
--- a/src/readerfactory.c
+++ b/src/readerfactory.c
@@ -615,8 +615,6 @@ LONG RFRemoveReader(const char *readerName, int port)
 
 LONG removeReader(READER_CONTEXT * sContext)
 {
-	LONG rv;
-
 	{
 		/* Try to destroy the thread */
 		if (sContext -> pthThread)
@@ -629,9 +627,7 @@ LONG removeReader(READER_CONTEXT * sContext)
 			return SCARD_E_INVALID_VALUE;
 		}
 
-		rv = RFUnInitializeReader(sContext);
-		if (rv != SCARD_S_SUCCESS)
-			return rv;
+		RFUnInitializeReader(sContext);
 
 		*sContext->pMutex -= 1;
 
@@ -1124,7 +1120,7 @@ LONG RFInitializeReader(READER_CONTEXT * rContext)
 	return SCARD_S_SUCCESS;
 }
 
-LONG RFUnInitializeReader(READER_CONTEXT * rContext)
+void RFUnInitializeReader(READER_CONTEXT * rContext)
 {
 	Log2(PCSC_LOG_INFO, "Attempting shutdown of %s.",
 		rContext->readerState->readerName);
@@ -1149,7 +1145,7 @@ LONG RFUnInitializeReader(READER_CONTEXT * rContext)
 	rContext->readerState->cardAtrLength = READER_NOT_INITIALIZED;
 	rContext->readerState->cardProtocol = SCARD_PROTOCOL_UNDEFINED;
 
-	return SCARD_S_SUCCESS;
+	return;
 }
 
 SCARDHANDLE RFCreateReaderHandle(READER_CONTEXT * rContext)
diff --git a/src/readerfactory.h b/src/readerfactory.h
index 24f1b69..8eeb00e 100644
--- a/src/readerfactory.h
+++ b/src/readerfactory.h
@@ -161,7 +161,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 	LONG RFUnBindFunctions(READER_CONTEXT *);
 	LONG RFUnloadReader(READER_CONTEXT *);
 	LONG RFInitializeReader(READER_CONTEXT *);
-	LONG RFUnInitializeReader(READER_CONTEXT *);
+	void RFUnInitializeReader(READER_CONTEXT *);
 	SCARDHANDLE RFCreateReaderHandle(READER_CONTEXT *);
 	LONG RFDestroyReaderHandle(SCARDHANDLE hCard);
 	LONG RFAddReaderHandle(READER_CONTEXT *, SCARDHANDLE);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/PCSC.git



More information about the Pcsclite-cvs-commit mailing list