aboutsummaryrefslogtreecommitdiffstats
path: root/g13
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2012-01-19 21:27:44 +0000
committerWerner Koch <[email protected]>2012-01-25 13:50:47 +0000
commitccbb4c3652ee72386b8889358b829e256e1ebcda (patch)
tree3ca143583d70d57d70eb68cc24cf7498a59afa08 /g13
parentPort to npth. (diff)
downloadgnupg-ccbb4c3652ee72386b8889358b829e256e1ebcda.tar.gz
gnupg-ccbb4c3652ee72386b8889358b829e256e1ebcda.zip
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.
Diffstat (limited to 'g13')
-rw-r--r--g13/g13.c9
1 files changed, 6 insertions, 3 deletions
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);