[Pcsclite-cvs-commit] r3107 - /trunk/PCSC/src/winscard_clnt.c
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Fri Sep 5 07:50:10 UTC 2008
Author: rousseau
Date: Fri Sep 5 07:50:09 2008
New Revision: 3107
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=3107
Log:
move WaitForPcscdEvent() before doxygen doc of SCardGetStatusChange()
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=3107&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_clnt.c (original)
+++ trunk/PCSC/src/winscard_clnt.c Fri Sep 5 07:50:09 2008
@@ -1686,6 +1686,50 @@
PROFILE_END(rv)
return rv;
+}
+
+static long WaitForPcscdEvent(long dwTime)
+{
+ char filename[FILENAME_MAX];
+ char buf[1];
+ int fd;
+ struct timeval tv, *ptv = NULL;
+ struct timeval before, after;
+ fd_set read_fd;
+
+ if (INFINITE != dwTime)
+ {
+ if (dwTime < 0)
+ return 0;
+ gettimeofday(&before, NULL);
+ tv.tv_sec = dwTime/1000;
+ tv.tv_usec = dwTime*1000 - tv.tv_sec*1000000;
+ ptv = &tv;
+ }
+
+ snprintf(filename, sizeof(filename), "%s/event.%d.%d", PCSCLITE_EVENTS_DIR,
+ SYS_GetPID(), SYS_RandomInt(0, 0x10000));
+ mkfifo(filename, 0644);
+ fd = SYS_OpenFile(filename, O_RDONLY | O_NONBLOCK, 0);
+
+ FD_ZERO(&read_fd);
+ FD_SET(fd, &read_fd);
+
+ select(fd+1, &read_fd, NULL, NULL, ptv);
+
+ SYS_ReadFile(fd, buf, 1);
+ SYS_CloseFile(fd);
+
+ if (INFINITE != dwTime)
+ {
+ long int diff;
+
+ gettimeofday(&after, NULL);
+ diff = time_sub(&after, &before);
+ dwTime -= diff/1000;
+ }
+
+ return dwTime;
}
/**
@@ -1779,50 +1823,6 @@
* printf("reader state: 0x%04X\n", rgReaderStates[1].dwEventState);
* @endcode
*/
-static long WaitForPcscdEvent(long dwTime)
-{
- char filename[FILENAME_MAX];
- char buf[1];
- int fd;
- struct timeval tv, *ptv = NULL;
- struct timeval before, after;
- fd_set read_fd;
-
- if (INFINITE != dwTime)
- {
- if (dwTime < 0)
- return 0;
- gettimeofday(&before, NULL);
- tv.tv_sec = dwTime/1000;
- tv.tv_usec = dwTime*1000 - tv.tv_sec*1000000;
- ptv = &tv;
- }
-
- snprintf(filename, sizeof(filename), "%s/event.%d.%d", PCSCLITE_EVENTS_DIR,
- SYS_GetPID(), SYS_RandomInt(0, 0x10000));
- mkfifo(filename, 0644);
- fd = SYS_OpenFile(filename, O_RDONLY | O_NONBLOCK, 0);
-
- FD_ZERO(&read_fd);
- FD_SET(fd, &read_fd);
-
- select(fd+1, &read_fd, NULL, NULL, ptv);
-
- SYS_ReadFile(fd, buf, 1);
- SYS_CloseFile(fd);
-
- if (INFINITE != dwTime)
- {
- long int diff;
-
- gettimeofday(&after, NULL);
- diff = time_sub(&after, &before);
- dwTime -= diff/1000;
- }
-
- return dwTime;
-}
-
LONG SCardGetStatusChange(SCARDCONTEXT hContext, DWORD dwTimeout,
LPSCARD_READERSTATE_A rgReaderStates, DWORD cReaders)
{
More information about the Pcsclite-cvs-commit
mailing list