[Pcsclite-cvs-commit] r4629 - in /trunk/PCSC/src: dyn_unix.c ifdwrapper.c pcscdaemon.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Fri Jan 1 21:57:27 UTC 2010


Author: rousseau
Date: Fri Jan  1 21:57:26 2010
New Revision: 4629

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4629
Log:
better handling of PCSCLITE_STATIC_DRIVER as can be used on plateforms
using µClinux (without dynamic loader)

Thanks to Guo Wenxue for a proto-patch

Modified:
    trunk/PCSC/src/dyn_unix.c
    trunk/PCSC/src/ifdwrapper.c
    trunk/PCSC/src/pcscdaemon.c

Modified: trunk/PCSC/src/dyn_unix.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/dyn_unix.c?rev=4629&op=diff
==============================================================================
--- trunk/PCSC/src/dyn_unix.c (original)
+++ trunk/PCSC/src/dyn_unix.c Fri Jan  1 21:57:26 2010
@@ -29,6 +29,7 @@
 INTERNAL int DYN_LoadLibrary(void **pvLHandle, char *pcLibrary)
 {
 	*pvLHandle = NULL;
+#ifndef PCSCLITE_STATIC_DRIVER
 	*pvLHandle = dlopen(pcLibrary, RTLD_LAZY);
 
 	if (*pvLHandle == NULL)
@@ -36,6 +37,7 @@
 		Log3(PCSC_LOG_CRITICAL, "%s: %s", pcLibrary, dlerror());
 		return SCARD_F_UNKNOWN_ERROR;
 	}
+#endif
 
 	return SCARD_S_SUCCESS;
 }
@@ -44,6 +46,7 @@
 {
 	int ret;
 
+#ifndef PCSCLITE_STATIC_DRIVER
 	ret = dlclose(*pvLHandle);
 	*pvLHandle = NULL;
 
@@ -52,6 +55,7 @@
 		Log2(PCSC_LOG_CRITICAL, "%s", dlerror());
 		return SCARD_F_UNKNOWN_ERROR;
 	}
+#endif
 
 	return SCARD_S_SUCCESS;
 }
@@ -59,12 +63,13 @@
 INTERNAL int DYN_GetAddress(void *pvLHandle, void **pvFHandle, const char *pcFunction)
 {
 	char pcFunctionName[256];
-	int rv;
+	int rv = SCARD_S_SUCCESS;
 
 	/* Some platforms might need a leading underscore for the symbol */
 	(void)snprintf(pcFunctionName, sizeof(pcFunctionName), "_%s", pcFunction);
 
 	*pvFHandle = NULL;
+#ifndef PCSCLITE_STATIC_DRIVER
 	*pvFHandle = dlsym(pvLHandle, pcFunctionName);
 
 	/* Failed? Try again without the leading underscore */
@@ -75,8 +80,8 @@
 	{
 		Log3(PCSC_LOG_CRITICAL, "%s: %s", pcFunction, dlerror());
 		rv = SCARD_F_UNKNOWN_ERROR;
-	} else
-		rv = SCARD_S_SUCCESS;
+	}
+#endif
 
 	return rv;
 }

Modified: trunk/PCSC/src/ifdwrapper.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/ifdwrapper.c?rev=4629&op=diff
==============================================================================
--- trunk/PCSC/src/ifdwrapper.c (original)
+++ trunk/PCSC/src/ifdwrapper.c Fri Jan  1 21:57:26 2010
@@ -28,8 +28,6 @@
 #include "dyn_generic.h"
 #include "sys_generic.h"
 #include "utils.h"
-
-#undef PCSCLITE_STATIC_DRIVER
 
 /**
  * Set the protocol type selection (PTS).

Modified: trunk/PCSC/src/pcscdaemon.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/pcscdaemon.c?rev=4629&op=diff
==============================================================================
--- trunk/PCSC/src/pcscdaemon.c (original)
+++ trunk/PCSC/src/pcscdaemon.c Fri Jan  1 21:57:26 2010
@@ -116,6 +116,7 @@
 	(void)signal(SIGHUP, SIG_IGN);	/* needed for Solaris. The signal is sent
 				 * when the shell is existed */
 
+#ifndef PCSCLITE_STATIC_DRIVER
 	/*
 	 * Set up the search for USB/PCMCIA devices
 	 */
@@ -126,6 +127,7 @@
 	rsp = HPRegisterForHotplugEvents();
 	if (rsp)
 		return;
+#endif
 
 	/*
 	 * Set up the power management callback routine




More information about the Pcsclite-cvs-commit mailing list