[Pcsclite-cvs-commit] PCSC/src winscard_scf.c,1.4,1.5

aet-guest@quantz.debian.org aet-guest@quantz.debian.org
Mon, 08 Sep 2003 14:04:16 +0200


Update of /cvsroot/pcsclite/PCSC/src
In directory quantz:/tmp/cvs-serv13319

Modified Files:
	winscard_scf.c 
Log Message:
Build fixes, add dummy SCardUnload()


Index: winscard_scf.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/winscard_scf.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- winscard_scf.c	8 Sep 2003 08:50:50 -0000	1.4
+++ winscard_scf.c	8 Sep 2003 12:04:13 -0000	1.5
@@ -1686,13 +1686,14 @@
   return SCARD_F_UNKNOWN_ERROR;
      
 }
+
 LONG SCardCheckReaderAvailability( LPSTR readerName, LONG errorCode ) {
 
   LONG retIndice;
   int i;
 
   retIndice=0; i=0;
-#ifdef 0  
+#if 0
   if ( errorCode != SCARD_S_SUCCESS ) {
     for ( i=0; i < PCSCLITE_MAX_CONTEXTS; i++ ) {
       if ( strcmp(psChannelMap[i].readerName, readerName) == 0 ) {
@@ -1709,10 +1710,27 @@
   return 0;
 
 }
+
+/*
+ * free resources allocated by the library
+ * You _shall_ call this function if you use dlopen/dlclose to load/unload the
+ * library. Otherwise you will exhaust the ressources available.
+ */
+void SCardUnload(void)
+{
+#if 0
+	if (!isExecuted)
+		return;
+
+	SHMClientCloseSession();
+	SYS_CloseFile(mapAddr);
+	isExecuted = 0;
+#endif
+}
+
 LONG SCardCheckDaemonAvailability() {
 
   LONG rv = 1;	/* assume it exists */
-  int fd;
 
   if ( rv == 0 ) {
     return SCARD_E_NO_SERVICE;