1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-08 23:37:47 +02:00

watch: call notification to app_wait from scd_update_reader_status_file.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2020-03-17 14:23:10 +09:00
parent 213d36cead
commit 3efe450ece
3 changed files with 5 additions and 10 deletions

View File

@ -1937,6 +1937,7 @@ scd_update_reader_status_file (void)
{
card_t card, card_next;
int periodical_check_needed = 0;
int reported = 0;
npth_mutex_lock (&card_list_lock);
for (card = card_top; card; card = card_next)
@ -1971,6 +1972,7 @@ scd_update_reader_status_file (void)
{
report_change (card->slot, card->card_status, status);
send_client_notifications (card, status == 0);
reported++;
if (status == 0)
{
@ -1995,6 +1997,9 @@ scd_update_reader_status_file (void)
}
}
if (reported)
npth_cond_broadcast (&notify_cond);
npth_mutex_unlock (&card_list_lock);
return periodical_check_needed;
@ -2292,12 +2297,6 @@ app_do_with_keygrip (ctrl_t ctrl, int action, const char *keygrip_str,
return c;
}
void
app_notify (void)
{
npth_cond_broadcast (&notify_cond);
}
int
app_wait (void)
{

View File

@ -1220,9 +1220,6 @@ scd_kick_the_loop (void)
log_error ("SetEvent for scd_kick_the_loop failed: %s\n",
gpg_strerror (gpg_error_from_syserror ()));
#endif
/* Also, notify watching threads. */
app_notify ();
}
/* Connection handler loop. Wait for connection requests and spawn a

View File

@ -154,6 +154,5 @@ int get_active_connection_count (void);
/*-- app.c --*/
int scd_update_reader_status_file (void);
int app_wait (void);
void app_notify (void);
#endif /*SCDAEMON_H*/