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

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