[Pcsclite-git-commit] [pcsc-tools] 17/32: pcsc_scan: animate "Waiting for first reader"

Ludovic Rousseau rousseau at moszumanska.debian.org
Thu May 4 15:44:48 UTC 2017


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

rousseau pushed a commit to branch master
in repository pcsc-tools.

commit 0f1967391a485f57ba86a89b3863931e6ff06aeb
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Sat Apr 8 15:01:13 2017 +0200

    pcsc_scan: animate "Waiting for first reader"
---
 pcsc_scan.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pcsc_scan.c b/pcsc_scan.c
index 7717d4a..cd71d12 100644
--- a/pcsc_scan.c
+++ b/pcsc_scan.c
@@ -242,7 +242,7 @@ get_readers:
 
 	if (SCARD_E_NO_READERS_AVAILABLE == rv || 0 == nbReaders)
 	{
-		printf("%sWaiting for the first reader...%s", red, color_end);
+		printf("%sWaiting for the first reader...%s   ", red, color_end);
 		fflush(stdout);
 
 		if (pnp)
@@ -256,13 +256,16 @@ get_readers:
 		else
 		{
 			rv = SCARD_S_SUCCESS;
+			spin_start();
 			while ((SCARD_S_SUCCESS == rv) && (dwReaders == dwReadersOld))
 			{
 				rv = SCardListReaders(hContext, NULL, NULL, &dwReaders);
 				if (SCARD_E_NO_READERS_AVAILABLE == rv)
 					rv = SCARD_S_SUCCESS;
 				sleep(1);
+				spin_update();
 			}
+			spin_suspend();
 		}
 		printf("found one\n");
 		goto get_readers;

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



More information about the Pcsclite-cvs-commit mailing list