[Pcsclite-cvs-commit] r6018 - /trunk/PCSC/src/winscard_clnt.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Fri Oct 7 20:29:08 UTC 2011


Author: rousseau
Date: Fri Oct  7 20:29:08 2011
New Revision: 6018

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6018
Log:
SCardEstablishContext(): check the return value of pcscd

In auto-start mode the client check the value returned by pcscd. If
pcscd failed to start then we just return SCARD_E_NO_SERVICE without
waiting for 5 seconds.

See Red Hat Bug 653903 - elinks takes 10 seconds to start 

Modified:
    trunk/PCSC/src/winscard_clnt.c

Modified: trunk/PCSC/src/winscard_clnt.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard_clnt.c?rev=6018&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_clnt.c (original)
+++ trunk/PCSC/src/winscard_clnt.c Fri Oct  7 20:29:08 2011
@@ -480,7 +480,7 @@
 		}
 		else
 		{
-			int pid;
+			int pid, stat_loc;
 			struct stat mystat;
 
 			/* If the daemon is not present then just fail without waiting */
@@ -524,8 +524,14 @@
 			/* father process */
 			daemon_launched = TRUE;
 
-			if (waitpid(pid, NULL, 0) < 0)
+			if (waitpid(pid, &stat_loc, 0) < 0)
 				Log2(PCSC_LOG_CRITICAL, "waitpid failed: %s", strerror(errno));
+			else
+			{
+				Log2(PCSC_LOG_INFO, "return value: %d", stat_loc);
+				if (stat_loc)
+					return SCARD_E_NO_SERVICE;
+			}
 
 			goto again;
 		}




More information about the Pcsclite-cvs-commit mailing list