mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-28 20:51:06 +01: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:
parent
213d36cead
commit
3efe450ece
11
scd/app.c
11
scd/app.c
@ -1937,6 +1937,7 @@ scd_update_reader_status_file (void)
|
|||||||
{
|
{
|
||||||
card_t card, card_next;
|
card_t card, card_next;
|
||||||
int periodical_check_needed = 0;
|
int periodical_check_needed = 0;
|
||||||
|
int reported = 0;
|
||||||
|
|
||||||
npth_mutex_lock (&card_list_lock);
|
npth_mutex_lock (&card_list_lock);
|
||||||
for (card = card_top; card; card = card_next)
|
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);
|
report_change (card->slot, card->card_status, status);
|
||||||
send_client_notifications (card, status == 0);
|
send_client_notifications (card, status == 0);
|
||||||
|
reported++;
|
||||||
|
|
||||||
if (status == 0)
|
if (status == 0)
|
||||||
{
|
{
|
||||||
@ -1995,6 +1997,9 @@ scd_update_reader_status_file (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (reported)
|
||||||
|
npth_cond_broadcast (¬ify_cond);
|
||||||
|
|
||||||
npth_mutex_unlock (&card_list_lock);
|
npth_mutex_unlock (&card_list_lock);
|
||||||
|
|
||||||
return periodical_check_needed;
|
return periodical_check_needed;
|
||||||
@ -2292,12 +2297,6 @@ app_do_with_keygrip (ctrl_t ctrl, int action, const char *keygrip_str,
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
app_notify (void)
|
|
||||||
{
|
|
||||||
npth_cond_broadcast (¬ify_cond);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
app_wait (void)
|
app_wait (void)
|
||||||
{
|
{
|
||||||
|
@ -1220,9 +1220,6 @@ scd_kick_the_loop (void)
|
|||||||
log_error ("SetEvent for scd_kick_the_loop failed: %s\n",
|
log_error ("SetEvent for scd_kick_the_loop failed: %s\n",
|
||||||
gpg_strerror (gpg_error_from_syserror ()));
|
gpg_strerror (gpg_error_from_syserror ()));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Also, notify watching threads. */
|
|
||||||
app_notify ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Connection handler loop. Wait for connection requests and spawn a
|
/* Connection handler loop. Wait for connection requests and spawn a
|
||||||
|
@ -154,6 +154,5 @@ int get_active_connection_count (void);
|
|||||||
/*-- app.c --*/
|
/*-- app.c --*/
|
||||||
int scd_update_reader_status_file (void);
|
int scd_update_reader_status_file (void);
|
||||||
int app_wait (void);
|
int app_wait (void);
|
||||||
void app_notify (void);
|
|
||||||
|
|
||||||
#endif /*SCDAEMON_H*/
|
#endif /*SCDAEMON_H*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user