aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scd/ChangeLog5
-rw-r--r--scd/command.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/scd/ChangeLog b/scd/ChangeLog
index d6e442332..fec70991a 100644
--- a/scd/ChangeLog
+++ b/scd/ChangeLog
@@ -1,3 +1,8 @@
+2006-08-30 Marcus Brinkmann <[email protected]>
+
+ * command.c (do_reset): Delay resetting CTRL->reader_slot until
+ after update_card_removed invocation.
+
2006-08-28 Marcus Brinkmann <[email protected]>
* app-openpgp.c (do_decipher, do_sign): Allow "OPENPGP.2"
diff --git a/scd/command.c b/scd/command.c
index 4629d9edf..d0e13b833 100644
--- a/scd/command.c
+++ b/scd/command.c
@@ -212,7 +212,6 @@ do_reset (ctrl_t ctrl, int send_reset)
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 @@ do_reset (ctrl_t ctrl, int send_reset)
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;
}