[Pcsclite-cvs-commit] r3099 - /trunk/PCSC/src/pcscdaemon.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue Aug 26 09:15:40 UTC 2008


Author: rousseau
Date: Tue Aug 26 09:15:40 2008
New Revision: 3099

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=3099
Log:
main(): create PCSCLITE_EVENTS_DIR directory
clean_temp_files(): purge & remove PCSCLITE_EVENTS_DIR directory

Modified:
    trunk/PCSC/src/pcscdaemon.c

Modified: trunk/PCSC/src/pcscdaemon.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/pcscdaemon.c?rev=3099&op=diff
==============================================================================
--- trunk/PCSC/src/pcscdaemon.c (original)
+++ trunk/PCSC/src/pcscdaemon.c Tue Aug 26 09:15:40 2008
@@ -445,6 +445,24 @@
 				strerror(errno));
 	}
 
+	/*
+	 * If PCSCLITE_EVENTS does not exist then create it
+	 */
+	rv = SYS_Stat(PCSCLITE_EVENTS_DIR, &fStatBuf);
+	if (rv < 0)
+	{
+		int mode = S_IRWXU | S_IWGRP | S_IXGRP | S_IWOTH | S_IXOTH; /* 0755 */
+
+		rv = SYS_Mkdir(PCSCLITE_EVENTS_DIR, mode);
+		if (rv != 0)
+		{
+			Log2(PCSC_LOG_CRITICAL,
+				"cannot create " PCSCLITE_EVENTS_DIR ": %s", strerror(errno));
+			return EXIT_FAILURE;
+		}
+		SYS_Chmod(PCSCLITE_EVENTS_DIR, mode);
+	}
+
 	/* cleanly remove /var/run/pcscd/pcsc.* files when exiting */
 	if (atexit(at_exit))
 		Log2(PCSC_LOG_CRITICAL, "atexit() failed: %s", strerror(errno));
@@ -546,6 +564,12 @@
 	rv = SYS_RemoveFile(PCSCLITE_RUN_PID);
 	if (rv != 0)
 		Log2(PCSC_LOG_ERROR, "Cannot remove " PCSCLITE_RUN_PID ": %s",
+			strerror(errno));
+
+	StatSynchronize(NULL);
+	rv = SYS_RemoveFile(PCSCLITE_EVENTS_DIR);
+	if (rv != 0)
+		Log2(PCSC_LOG_ERROR, "Cannot remove " PCSCLITE_EVENTS_DIR ": %s",
 			strerror(errno));
 }
 




More information about the Pcsclite-cvs-commit mailing list