[Pcsclite-cvs-commit] r5487 - /trunk/pcsc-tools/pcsc_scan.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Wed Jan 5 13:16:10 UTC 2011


Author: rousseau
Date: Wed Jan  5 13:16:07 2011
New Revision: 5487

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5487
Log:
Display a timestamp only for each event, not for each reader on the
same event.

Modified:
    trunk/pcsc-tools/pcsc_scan.c

Modified: trunk/pcsc-tools/pcsc_scan.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/pcsc-tools/pcsc_scan.c?rev=5487&op=diff
==============================================================================
--- trunk/pcsc-tools/pcsc_scan.c (original)
+++ trunk/pcsc-tools/pcsc_scan.c Wed Jan  5 13:16:07 2011
@@ -293,6 +293,8 @@
 	rv = SCardGetStatusChange(hContext, timeout, rgReaderStates_t, nbReaders);
 	while ((rv == SCARD_S_SUCCESS) || (rv == SCARD_E_TIMEOUT))
 	{
+		time_t t;
+
 		if (pnp)
 		{
 			if (rgReaderStates_t[nbReaders-1].dwEventState &
@@ -307,12 +309,14 @@
 				goto get_readers;
 		}
 
+		/* Timestamp the event as we get notified */
+		t = time(NULL);
+		printf("\n%s", ctime(&t));
+
 		/* Now we have an event, check all the readers in the list to see what
 		 * happened */
 		for (current_reader=0; current_reader < nbReaders; current_reader++)
 		{
-			time_t t;
-
 			if (rgReaderStates_t[current_reader].dwEventState &
 				SCARD_STATE_CHANGED)
 			{
@@ -330,11 +334,8 @@
 			 * above.
 			 */
 
-			/* Timestamp the event as we get notified */
-			t = time(NULL);
-
 			/* Specify the current reader's number and name */
-			printf("\n%s Reader %d: %s%s%s\n", ctime(&t), current_reader,
+			printf("Reader %d: %s%s%s\n", current_reader,
 				magenta, rgReaderStates_t[current_reader].szReader,
 				color_end);
 




More information about the Pcsclite-cvs-commit mailing list