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

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