summaryrefslogtreecommitdiffstats
path: root/scd/command.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2021-10-29 03:48:01 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2021-10-29 03:58:26 +0200
commit48e824b6ea69d21ccbc50aac125d8b442af66727 (patch)
treec59853c839326fb2b771378cf55bdb7354669660 /scd/command.c
parentcommon: Support MYPROC_SELF_EXE for Solaris (diff)
downloadgnupg2-48e824b6ea69d21ccbc50aac125d8b442af66727.tar.xz
gnupg2-48e824b6ea69d21ccbc50aac125d8b442af66727.zip
scd: Modify DEVINFO behavior to support looping forever.
* scd/app.c (struct mrsw_lock): Add notify_cond member. (notify_cond): Remove. (card_list_r_lock, card_list_r_unlock): Rename. (card_list_w_lock, card_list_w_unlock): Rename. (card_list_signal, card_list_wait): New, fixing thinko about notify/wakeup with MRSW lock. (app_send_devinfo): Support looping. (select_application): Notify app_send_devinfo thread for newly detected device. (initialize_module_command): Initialize notify_cond member. (app_wait): Remove. * scd/command.c (cmd_devinfo): Use new API of app_send_devinfo. * scd/scdaemon.h (app_wait): Remove. -- GnuPG-bug-id: 5359 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'scd/command.c')
-rw-r--r--scd/command.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/scd/command.c b/scd/command.c
index 6ffc13626..2128298c6 100644
--- a/scd/command.c
+++ b/scd/command.c
@@ -2279,7 +2279,7 @@ cmd_devinfo (assuan_context_t ctx, char *line)
}
/* Firstly, send information of available devices. */
- err = app_send_devinfo (ctrl);
+ err = app_send_devinfo (ctrl, 0);
/* If not watching, that's all. */
if (!watch)
@@ -2311,16 +2311,10 @@ cmd_devinfo (assuan_context_t ctx, char *line)
}
/* Then, keep watching the status change. */
- while (!err)
- {
- app_wait ();
-
- /* Send information of available devices. */
- err = app_send_devinfo (ctrl);
- }
+ err = app_send_devinfo (ctrl, 1);
ctrl->server_local->watching_status = 0;
- return 0;
+ return err;
}
/* Return true if the command CMD implements the option OPT. */