[Pcsclite-cvs-commit] r3156 - in /trunk/PCSC/src: utils.c utils.h

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue Oct 7 12:27:01 UTC 2008


Author: rousseau
Date: Tue Oct  7 12:27:01 2008
New Revision: 3156

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=3156
Log:
add CheckForOpenCT()

Modified:
    trunk/PCSC/src/utils.c
    trunk/PCSC/src/utils.h

Modified: trunk/PCSC/src/utils.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/utils.c?rev=3156&op=diff
==============================================================================
--- trunk/PCSC/src/utils.c (original)
+++ trunk/PCSC/src/utils.c Tue Oct  7 12:27:01 2008
@@ -149,3 +149,25 @@
 	return 0;
 } /* StatSynchronize */
 
+
+/**
+ * Check is OpenCT is running and display a critical message if it is
+ *
+ * The first cause of pcsc-lite failure is that OpenCT is installed and running
+ * and has already claimed the USB device. In that case RFAddReader() fails
+ * and I get a user support request
+ */
+#define OPENCT_FILE "/var/run/openct/status"
+int CheckForOpenCT(void)
+{
+	struct stat buf;
+
+	if (0 == stat(OPENCT_FILE, &buf))
+	{
+		Log1(PCSC_LOG_CRITICAL, "Remove OpenCT and try again");
+		return 1;
+	}
+
+	return 0;
+} /* CheckForOpenCT */
+

Modified: trunk/PCSC/src/utils.h
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/utils.h?rev=3156&op=diff
==============================================================================
--- trunk/PCSC/src/utils.h (original)
+++ trunk/PCSC/src/utils.h Tue Oct  7 12:27:01 2008
@@ -23,5 +23,7 @@
 
 int StatSynchronize(struct pubReaderStatesList *readerState);
 
+int CheckForOpenCT(void);
+
 #endif
 




More information about the Pcsclite-cvs-commit mailing list