aboutsummaryrefslogtreecommitdiffstats
path: root/devel/pcsc-lite/files/patch-winscard_msg_srv.c
blob: 0a5c681cb6ca5c384a15f2c20c9e12451eb80e8c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--- src/winscard_msg_srv.c.orig Mon Jan 22 16:26:53 2007
+++ src/winscard_msg_srv.c  Mon Jan 22 16:29:52 2007
@@ -169,6 +169,10 @@
 {
    fd_set read_fd;
    int selret;
+   struct timeval tv;
+
+   tv.tv_sec = 1;
+   tv.tv_usec = 0;
 
    FD_ZERO(&read_fd);
 
@@ -178,7 +182,7 @@
    FD_SET(commonSocket, &read_fd);
 
    selret = select(commonSocket + 1, &read_fd, (fd_set *) NULL,
-       (fd_set *) NULL, NULL);
+       (fd_set *) NULL, &tv);
 
    if (selret < 0)
    {
@@ -189,6 +193,10 @@
            strerror(errno));
        return -1;
    }
+
+   if (selret == 0)
+       /* timeout */
+       return 2;
 
    /*
     * A common pipe packet has arrived - it could be a new application