diff options
author | Justus Winter <justus@g10code.com> | 2016-10-19 12:20:44 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2016-11-12 19:55:05 +0100 |
commit | 40e5ff0a0084c0d9521b401db4f38885bfdae233 (patch) | |
tree | ce754e1533719e6931d11480adc4ca28aad5d12f /tests | |
parent | e15416d3668ea9dcc6a64cbb98140a99be8a7865 (diff) | |
download | libgpg-error-40e5ff0a0084c0d9521b401db4f38885bfdae233.tar.gz |
estream: Support 'es_poll' on Windows.
* src/Makefile.am (arch_sources): Add new file.
* src/estream.c (O_NONBLOCK): Move to 'gpgrt-int.h'.
(BUFFER_BLOCK_SIZE): Likewise.
(BUFFER_UNREAD_SIZE): Likewise.
(struct notify_list_s, notify_list_t): Likewise.
(struct _gpgrt_stream_internal, estream_internal_t): Likewise.
(X_POLLABLE): New macro.
(parse_mode): Parse keyword 'pollable', emulate O_NONBLOCK using the
same mechanism on Windows.
(_gpgrt_poll): Use the new '_gpgrt_w32_poll' on Windows.
* src/gpgrt-int.h (_gpgrt_functions_w32_pollable): New declaration.
(_gpgrt_w32_pollable_create): New prototype.
(_gpgrt_w32_poll): Likewise.
* src/w32-estream.c: New file. This code is adapted from GPGME.
* tests/t-poll.c (create_pipe): Create pollable streams.
GnuPG-bug-id: 2731
Signed-off-by: Justus Winter <justus@g10code.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/t-poll.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/t-poll.c b/tests/t-poll.c index 026bb88..d39797a 100644 --- a/tests/t-poll.c +++ b/tests/t-poll.c @@ -191,14 +191,14 @@ create_pipe (estream_t *r_in, estream_t *r_out) show ("created pipe [%d, %d]\n", filedes[0], filedes[1]); - *r_in = es_fdopen (filedes[0], "r"); + *r_in = es_fdopen (filedes[0], "r,pollable"); if (!*r_in) { err = gpg_error_from_syserror (); die ("error creating a stream for a pipe: %s\n", gpg_strerror (err)); } - *r_out = es_fdopen (filedes[1], "w"); + *r_out = es_fdopen (filedes[1], "w,pollable"); if (!*r_out) { err = gpg_error_from_syserror (); |