diff options
author | Marcus Brinkmann <[email protected]> | 2006-08-30 15:57:17 +0000 |
---|---|---|
committer | Marcus Brinkmann <[email protected]> | 2006-08-30 15:57:17 +0000 |
commit | 9bdb549dc457e12768abffd421116b3dac2e0810 (patch) | |
tree | c9980a53a4894a6c848a7071fe9342e14e97fc4f /scd/command.c | |
parent | 2006-08-28 Marcus Brinkmann <[email protected]> (diff) | |
download | gnupg-9bdb549dc457e12768abffd421116b3dac2e0810.tar.gz gnupg-9bdb549dc457e12768abffd421116b3dac2e0810.zip |
2006-08-30 Marcus Brinkmann <[email protected]>
* command.c (do_reset): Delay resetting CTRL->reader_slot until
after update_card_removed invocation.
Diffstat (limited to '')
-rw-r--r-- | scd/command.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |