agent,dirmngr,kbx,scd,tpm2d: Use gnupg_sleep.

* agent/findkey.c (unprotect): Use gnupg_sleep.
* agent/gpg-agent.c (handle_connections): Likewise.
* dirmngr/crlfetch.c (handle_connections): Likewise.
* kbx/keyboxd.c (handle_connections): Likewise.
* tpm2d/tpm3daemon.c (handle_connections): Likewise.
* scd/scdaemon.c (handle_connections): Likewise.
* scd/command.c (cmd_lock): Likewise.
* dirmngr/ldap-wrapper.c (ldap_reaper_thread): Likewise.
(ldap_wrapper_wait_connections): Use gnupg_usleep.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2021-10-05 14:05:56 +09:00
parent eeb25df6f8
commit 3918fa1a94
9 changed files with 13 additions and 13 deletions

View File

@ -721,7 +721,7 @@ unprotect (ctrl_t ctrl, const char *cache_nonce, const char *desc_text,
{ {
/* We need to give the other thread a chance to actually put /* We need to give the other thread a chance to actually put
it into the cache. */ it into the cache. */
npth_sleep (1); gnupg_sleep (1);
goto retry; goto retry;
} }
/* Timeout - better call pinentry now the plain way. */ /* Timeout - better call pinentry now the plain way. */

View File

@ -3041,7 +3041,7 @@ handle_connections (gnupg_fd_t listen_fd,
{ {
log_error (_("npth_pselect failed: %s - waiting 1s\n"), log_error (_("npth_pselect failed: %s - waiting 1s\n"),
strerror (saved_errno)); strerror (saved_errno));
npth_sleep (1); gnupg_sleep (1);
continue; continue;
} }
if (ret <= 0) if (ret <= 0)

View File

@ -73,7 +73,7 @@ register_file_reader (ksba_reader_t reader, struct reader_cb_context_s *cb_ctx)
return; return;
} }
log_info (_("reader to file mapping table full - waiting\n")); log_info (_("reader to file mapping table full - waiting\n"));
npth_sleep (2); gnupg_sleep (2);
} }
} }

View File

@ -2321,7 +2321,7 @@ handle_connections (assuan_fd_t listen_fd)
{ {
log_error (_("npth_pselect failed: %s - waiting 1s\n"), log_error (_("npth_pselect failed: %s - waiting 1s\n"),
strerror (saved_errno)); strerror (saved_errno));
npth_sleep (1); gnupg_sleep (1);
continue; continue;
} }

View File

@ -329,7 +329,7 @@ ldap_reaper_thread (void *dummy)
" - waiting 1s\n", gpg_strerror (err)); " - waiting 1s\n", gpg_strerror (err));
/* Note: Here we unlock and continue! */ /* Note: Here we unlock and continue! */
unlock_reaper_list (); unlock_reaper_list ();
npth_sleep (1); gnupg_sleep (1);
continue; continue;
} }
fparraysize = count; fparraysize = count;
@ -393,7 +393,7 @@ ldap_reaper_thread (void *dummy)
xfree (fparray); xfree (fparray);
fparray = NULL; fparray = NULL;
fparraysize = 0; fparraysize = 0;
npth_sleep (1); gnupg_sleep (1);
continue; continue;
} }
@ -582,7 +582,7 @@ ldap_wrapper_wait_connections ()
} }
unlock_reaper_list (); unlock_reaper_list ();
while (reaper_list) while (reaper_list)
npth_usleep (200); gnupg_usleep (200);
} }

View File

@ -1607,7 +1607,7 @@ handle_connections (gnupg_fd_t listen_fd)
{ {
log_error (_("npth_pselect failed: %s - waiting 1s\n"), log_error (_("npth_pselect failed: %s - waiting 1s\n"),
strerror (saved_errno)); strerror (saved_errno));
npth_sleep (1); gnupg_sleep (1);
continue; continue;
} }
if (ret <= 0) if (ret <= 0)

View File

@ -1726,9 +1726,9 @@ cmd_lock (assuan_context_t ctx, char *line)
if (rc && has_option (line, "--wait")) if (rc && has_option (line, "--wait"))
{ {
rc = 0; rc = 0;
npth_sleep (1); /* Better implement an event mechanism. However, gnupg_sleep (1); /* Better implement an event mechanism. However,
for card operations this should be for card operations this should be
sufficient. */ sufficient. */
/* Send a progress so that we can detect a connection loss. */ /* Send a progress so that we can detect a connection loss. */
rc = send_status_printf (ctrl, "PROGRESS", "scd_locked . 0 0"); rc = send_status_printf (ctrl, "PROGRESS", "scd_locked . 0 0");
if (!rc) if (!rc)

View File

@ -1375,7 +1375,7 @@ handle_connections (int listen_fd)
{ {
log_error (_("npth_pselect failed: %s - waiting 1s\n"), log_error (_("npth_pselect failed: %s - waiting 1s\n"),
strerror (saved_errno)); strerror (saved_errno));
npth_sleep (1); gnupg_sleep (1);
continue; continue;
} }

View File

@ -1215,7 +1215,7 @@ handle_connections (int listen_fd)
{ {
log_error (_("npth_pselect failed: %s - waiting 1s\n"), log_error (_("npth_pselect failed: %s - waiting 1s\n"),
strerror (saved_errno)); strerror (saved_errno));
npth_sleep (1); gnupg_sleep (1);
continue; continue;
} }