Blame SOURCES/pcsc-lite-1.8.8-no-hang-systemd.patch

c3e589
diff -up ./src/winscard_clnt.c.no-hang ./src/winscard_clnt.c
c3e589
--- ./src/winscard_clnt.c.no-hang	2012-08-25 07:29:44.000000000 -0700
c3e589
+++ ./src/winscard_clnt.c	2017-10-30 17:54:07.275158662 -0700
c3e589
@@ -124,6 +124,8 @@ static char sharing_shall_block = TRUE;
c3e589
 #define COLOR_MAGENTA "\33[35m"
c3e589
 #define COLOR_NORMAL "\33[0m"
c3e589
 
c3e589
+#define TIMEOUT_TIME  3 /* time to wait for an answer to the server on first connection (in seconds) */
c3e589
+
c3e589
 #ifdef DO_TRACE
c3e589
 
c3e589
 #include <stdio.h>
c3e589
@@ -558,7 +560,8 @@ static LONG SCardEstablishContextTH(DWOR
c3e589
 			return rv;
c3e589
 
c3e589
 		/* Read a message from the server */
c3e589
-		rv = MessageReceive(&veStr, sizeof(veStr), dwClientID);
c3e589
+		rv = MessageReceiveTimeout(CMD_VERSION, &veStr, sizeof(veStr),
c3e589
+					dwClientID, TIMEOUT_TIME*1000L);
c3e589
 		if (rv != SCARD_S_SUCCESS)
c3e589
 		{
c3e589
 			Log1(PCSC_LOG_CRITICAL,