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

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Thu Nov 1 16:14:13 UTC 2007


Author: rousseau
Date: Thu Nov  1 16:14:13 2007
New Revision: 2678

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=2678
Log:
main(): create PCSCLITE_IPC_DIR _before_ writing PCSCLITE_RUN_PID

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=2678&op=diff
==============================================================================
--- trunk/PCSC/src/pcscdaemon.c (original)
+++ trunk/PCSC/src/pcscdaemon.c Thu Nov  1 16:14:13 2007
@@ -418,6 +418,22 @@
 	signal(SIGHUP, signal_trap);
 
 	/*
+	 * If PCSCLITE_IPC_DIR does not exist then create it
+	 */
+	rv = SYS_Stat(PCSCLITE_IPC_DIR, &fStatBuf);
+	if (rv < 0)
+	{
+		rv = SYS_Mkdir(PCSCLITE_IPC_DIR,
+			S_ISVTX | S_IROTH | S_IXOTH | S_IRGRP | S_IXGRP | S_IRWXU);
+		if (rv != 0)
+		{
+			Log2(PCSC_LOG_CRITICAL,
+				"cannot create " PCSCLITE_IPC_DIR ": %s", strerror(errno));
+			return EXIT_FAILURE;
+		}
+	}
+
+	/*
 	 * Record our pid to make it easier
 	 * to kill the correct pcscd
 	 */
@@ -439,22 +455,6 @@
 		else
 			Log2(PCSC_LOG_CRITICAL, "cannot create " PCSCLITE_RUN_PID ": %s",
 				strerror(errno));
-	}
-
-	/*
-	 * If PCSCLITE_IPC_DIR does not exist then create it
-	 */
-	rv = SYS_Stat(PCSCLITE_IPC_DIR, &fStatBuf);
-	if (rv < 0)
-	{
-		rv = SYS_Mkdir(PCSCLITE_IPC_DIR,
-			S_ISVTX | S_IROTH | S_IXOTH | S_IRGRP | S_IXGRP | S_IRWXU);
-		if (rv != 0)
-		{
-			Log2(PCSC_LOG_CRITICAL,
-				"cannot create " PCSCLITE_IPC_DIR ": %s", strerror(errno));
-			return EXIT_FAILURE;
-		}
 	}
 
 	/* cleanly remove /var/run/pcsc.* files when exiting */




More information about the Pcsclite-cvs-commit mailing list