diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index a4025ce86..70d977539 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -941,6 +941,7 @@ thread_init_once (void) npth_initialized++; npth_init (); } + gpgrt_set_syscall_clamp (npth_unprotect, npth_protect); } diff --git a/common/init.c b/common/init.c index 8a8626682..cb4228a39 100644 --- a/common/init.c +++ b/common/init.c @@ -29,20 +29,12 @@ #include -#ifdef WITHOUT_NPTH /* Give the Makefile a chance to build without Pth. */ -#undef HAVE_NPTH -#undef USE_NPTH -#endif - #ifdef HAVE_W32_SYSTEM # ifdef HAVE_WINSOCK2_H # include # endif # include #endif -#ifdef HAVE_NPTH -# include -#endif #ifdef HAVE_W32CE_SYSTEM # include /* For _assuan_w32ce_finish_pipe. */ #endif @@ -197,9 +189,6 @@ _init_common_subsystems (gpg_err_source_t errsource, int *argcp, char ***argvp) /* Initialize the Estream library. */ gpgrt_init (); gpgrt_set_alloc_func (gcry_realloc); -#ifdef USE_NPTH - gpgrt_set_syscall_clamp (npth_unprotect, npth_protect); -#endif /* Special hack for Windows CE: We extract some options from arg to setup the standard handles. */ diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index 621c2bb9a..271360e1f 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -651,6 +651,7 @@ static void thread_init (void) { npth_init (); + gpgrt_set_syscall_clamp (npth_unprotect, npth_protect); /* Now with NPth running we can set the logging callback. Our windows implementation does not yet feature the NPth TLS diff --git a/scd/scdaemon.c b/scd/scdaemon.c index 3571e6614..df1abe8b7 100644 --- a/scd/scdaemon.c +++ b/scd/scdaemon.c @@ -723,6 +723,7 @@ main (int argc, char **argv ) #endif npth_init (); + gpgrt_set_syscall_clamp (npth_unprotect, npth_protect); /* If --debug-allow-core-dump has been given we also need to switch the working directory to a place where we can actually @@ -862,6 +863,7 @@ main (int argc, char **argv ) /* This is the child. */ npth_init (); + gpgrt_set_syscall_clamp (npth_unprotect, npth_protect); /* Detach from tty and put process into a new session. */ if (!nodetach )