diff options
author | Marcus Brinkmann <[email protected]> | 2012-01-03 21:12:37 +0000 |
---|---|---|
committer | Marcus Brinkmann <[email protected]> | 2012-01-25 13:07:08 +0000 |
commit | e917c07b2664bb01a5f7b5975723b90da0f396c9 (patch) | |
tree | e31e737fe07e96b596f8bbbaf16a1e122ac683ae /common/estream.c | |
parent | Require gitlog-to-changelog to be installed. (diff) | |
download | gnupg-npth-3.tar.gz gnupg-npth-3.zip |
Port to npth.npth-3
* configure.ac: Don't check for PTH but for NPTH.
(AH_BOTTOM): Remove PTH_SYSCALL_SOFT.
(have_pth): Rename to ...
(have_npth): ... this.
(USE_GNU_NPTH): Rename to ...
(USE_GNU_PTH): ... this.
* m4/npth.m4: New file.
* agent/Makefile.am, agent/cache.c, agent/call-pinentry.c,
agent/call-scd.c, agent/findkey.c, agent/gpg-agent.c,
agent/trustlist.c, common/Makefile.am, common/estream.c,
common/exechelp-posix.c, common/exechelp-w32.c,
common/exechelp-w32ce.c, common/http.c, common/init.c,
common/sysutils.c, dirmngr/Makefile.am, dirmngr/crlfetch.c,
dirmngr/dirmngr.c, dirmngr/dirmngr_ldap.c, dirmngr/ldap-wrapper-ce.c,
dirmngr/ldap-wrapper.c, dirmngr/ldap.c, g13/Makefile.am,
g13/call-gpg.c, g13/g13.c, g13/runner.c, scd/Makefile.am,
scd/apdu.c, scd/app.c, scd/ccid-driver.c, scd/command.c,
scd/scdaemon.c, tools/Makefile.am: Port to npth.
Diffstat (limited to 'common/estream.c')
-rw-r--r-- | common/estream.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/common/estream.c b/common/estream.c index 6b7bd8b75..81a12428a 100644 --- a/common/estream.c +++ b/common/estream.c @@ -85,13 +85,13 @@ # include <gpg-error.h> /* ERRNO replacement. */ #endif -#ifdef WITHOUT_GNU_PTH /* Give the Makefile a chance to build without Pth. */ -# undef HAVE_PTH -# undef USE_GNU_PTH +#ifdef WITHOUT_NPTH /* Give the Makefile a chance to build without Pth. */ +# undef HAVE_NPTH +# undef USE_NPTH #endif -#ifdef HAVE_PTH -# include <pth.h> +#ifdef HAVE_NPTH +# include <npth.h> #endif /* This is for the special hack to use estream.c in GnuPG. */ @@ -159,7 +159,7 @@ typedef void (*func_free_t) (void *mem); /* Locking. */ -#ifdef HAVE_PTH +#ifdef HAVE_NPTH typedef pth_mutex_t estream_mutex_t; # define ESTREAM_MUTEX_INITIALIZER PTH_MUTEX_INIT @@ -197,7 +197,7 @@ dummy_mutex_call_int (estream_mutex_t mutex) /* Primitive system I/O. */ -#ifdef HAVE_PTH +#ifdef HAVE_NPTH # define ESTREAM_SYS_READ do_pth_read # define ESTREAM_SYS_WRITE do_pth_write # define ESTREAM_SYS_YIELD() pth_yield (NULL) @@ -450,7 +450,7 @@ do_list_remove (estream_t stream, int with_locked_list) * write, assuming that we do I/O on a plain file where the operation * can't block. */ -#ifdef HAVE_PTH +#ifdef HAVE_NPTH static int do_pth_read (int fd, void *buffer, size_t size) { @@ -476,7 +476,7 @@ do_pth_write (int fd, const void *buffer, size_t size) return pth_write (fd, buffer, size); # endif /* !HAVE_W32_SYSTEM*/ } -#endif /*HAVE_PTH*/ +#endif /*HAVE_NPTH*/ @@ -507,7 +507,7 @@ do_init (void) if (!initialized) { -#ifdef HAVE_PTH +#ifdef HAVE_NPTH if (!pth_init () && errno != EPERM ) return -1; if (pth_mutex_init (&estream_list_lock)) @@ -1033,7 +1033,7 @@ es_func_w32_read (void *cookie, void *buffer, size_t size) { do { -#ifdef HAVE_PTH +#ifdef HAVE_NPTH /* Note: Our pth_read actually uses HANDLE! */ bytes_read = pth_read ((int)w32_cookie->hd, buffer, size); #else @@ -1078,7 +1078,7 @@ es_func_w32_write (void *cookie, const void *buffer, size_t size) { do { -#ifdef HAVE_PTH +#ifdef HAVE_NPTH /* Note: Our pth_write actually uses HANDLE! */ bytes_written = pth_write ((int)w32_cookie->hd, buffer, size); #else @@ -2713,7 +2713,6 @@ es_fopenmem (size_t memlimit, const char *ES__RESTRICT mode) return stream; } - /* This is the same as es_fopenmem but intializes the memory with a copy of (DATA,DATALEN). The stream is initally set to the @@ -2744,10 +2743,6 @@ es_fopenmem_init (size_t memlimit, const char *ES__RESTRICT mode, es_set_indicators (stream, 0, 0); } } - - if (stream) - stream->intern->func_ioctl = es_func_mem_ioctl; - return stream; } |