[svn] GnuPG - r4232 - trunk/scd

svn author marcus cvs at cvs.gnupg.org
Wed Aug 30 17:57:17 CEST 2006


Author: marcus
Date: 2006-08-30 17:57:17 +0200 (Wed, 30 Aug 2006)
New Revision: 4232

Modified:
   trunk/scd/ChangeLog
   trunk/scd/command.c
Log:
2006-08-30  Marcus Brinkmann  <marcus at g10code.de>

	* command.c (do_reset): Delay resetting CTRL->reader_slot until
	after update_card_removed invocation.


Modified: trunk/scd/ChangeLog
===================================================================
--- trunk/scd/ChangeLog	2006-08-29 18:29:30 UTC (rev 4231)
+++ trunk/scd/ChangeLog	2006-08-30 15:57:17 UTC (rev 4232)
@@ -1,3 +1,8 @@
+2006-08-30  Marcus Brinkmann  <marcus at g10code.de>
+
+	* command.c (do_reset): Delay resetting CTRL->reader_slot until
+	after update_card_removed invocation.
+
 2006-08-28  Marcus Brinkmann  <marcus at g10code.de>
 
 	* app-openpgp.c (do_decipher, do_sign): Allow "OPENPGP.2"

Modified: trunk/scd/command.c
===================================================================
--- trunk/scd/command.c	2006-08-29 18:29:30 UTC (rev 4231)
+++ trunk/scd/command.c	2006-08-30 15:57:17 UTC (rev 4232)
@@ -212,7 +212,6 @@
           slot_table[slot].reset_failed = 1;
         }
     }
-  ctrl->reader_slot = -1;
 
   /* If we hold a lock, unlock now. */
   if (locked_session && ctrl->server_local == locked_session)
@@ -229,12 +228,16 @@
   if (!pth_mutex_acquire (&status_file_update_lock, 0, NULL))
     {
       log_error ("failed to acquire status_fle_update lock\n");
+      ctrl->reader_slot = -1;
       return;
     }
   update_reader_status_file ();
   update_card_removed (slot, 0);
   if (!pth_mutex_release (&status_file_update_lock))
     log_error ("failed to release status_file_update lock\n");
+
+  /* Do this last, so that update_card_removed does its job.  */
+  ctrl->reader_slot = -1;
 }
 
 




More information about the Gnupg-commits mailing list