mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Port Windows code to NPTH.
* agent/gpg-agent.c (get_agent_ssh_socket_name): Use INVALID_HANDLE_VALUE instead of 0. (handle_signal) [!HAVE_W32_SYSTEM]: Don't define. (handle_connections): Port Windows code to NPTH. * dirmngr/dirmngr.c (handle_connections): Port Windows code to NPTH. * g13/g13.c (handle_connections): Port Windows code to NPTH. * scd/scdaemon.c (handle_connections): Port Windows code to NPTH.
This commit is contained in:
parent
7a7a597827
commit
ccbb4c3652
4 changed files with 33 additions and 24 deletions
|
@ -854,8 +854,6 @@ idle_task (void *dummy_arg)
|
|||
npth_sigev_add (SIGINT);
|
||||
npth_sigev_add (SIGTERM);
|
||||
npth_sigev_fini ();
|
||||
#else
|
||||
sigs = 0;
|
||||
#endif
|
||||
|
||||
npth_clock_gettime (&abstime);
|
||||
|
@ -882,12 +880,15 @@ idle_task (void *dummy_arg)
|
|||
}
|
||||
npth_timersub (&abstime, &curtime, &timeout);
|
||||
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
ret = npth_pselect (0, NULL, NULL, NULL, &timeout, npth_sigev_sigmask());
|
||||
saved_errno = errno;
|
||||
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
while (npth_sigev_get_pending(&signo))
|
||||
handle_signal (signo);
|
||||
#else
|
||||
ret = npth_eselect (0, NULL, NULL, NULL, &timeout, NULL, NULL);
|
||||
saved_errno = errno;
|
||||
#endif
|
||||
|
||||
if (ret == -1 && saved_errno != EINTR)
|
||||
|
@ -920,6 +921,7 @@ start_idle_task (void)
|
|||
sigset_t sigs; /* The set of signals we want to catch. */
|
||||
int err;
|
||||
|
||||
#ifndef HAVE_W32_SYSTEM
|
||||
/* These signals should always go to the idle task, so they need to
|
||||
be blocked everywhere else. We assume start_idle_task is called
|
||||
from the main thread before any other threads are created. */
|
||||
|
@ -930,6 +932,7 @@ start_idle_task (void)
|
|||
sigaddset (&sigs, SIGINT);
|
||||
sigaddset (&sigs, SIGTERM);
|
||||
npth_sigmask (SIG_BLOCK, &sigs, NULL);
|
||||
#endif
|
||||
|
||||
npth_attr_init (&tattr);
|
||||
npth_attr_setdetachstate (&tattr, NPTH_CREATE_JOINABLE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue