From ccbb4c3652ee72386b8889358b829e256e1ebcda Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Thu, 19 Jan 2012 22:27:44 +0100 Subject: 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. --- g13/g13.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'g13/g13.c') diff --git a/g13/g13.c b/g13/g13.c index 34b91c166..b33ea61ed 100644 --- a/g13/g13.c +++ b/g13/g13.c @@ -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); -- cgit v1.2.3