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

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Thu Jun 24 13:57:51 UTC 2010


Author: rousseau
Date: Thu Jun 24 13:57:49 2010
New Revision: 5039

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5039
Log:
signal_trap(): implement a "Forced suicide" mechanism.

After 3 Ctrl-C without much reaction from pcscd (in fact the drivers) we
force the suicide. Sometimes libusb is blocked in a kind of dead-lock
and kill -9 was the only option.

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=5039&op=diff
==============================================================================
--- trunk/PCSC/src/pcscdaemon.c (original)
+++ trunk/PCSC/src/pcscdaemon.c Thu Jun 24 13:57:49 2010
@@ -667,6 +667,19 @@
 			at_exit();
 		}
 	}
+	else
+	{
+		/* if pcscd do not want to die */
+		static int lives = 2;
+
+		lives--;
+		/* no live left. Something is blocking the normal death. */
+		if (0 == lives)
+		{
+			Log1(PCSC_LOG_INFO, "Forced suicide");
+			at_exit();
+		}
+	}
 }
 
 static void print_version (void)




More information about the Pcsclite-cvs-commit mailing list