diff options
author | Justus Winter <[email protected]> | 2016-10-19 10:20:44 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2016-11-12 18:55:05 +0000 |
commit | 40e5ff0a0084c0d9521b401db4f38885bfdae233 (patch) | |
tree | ce754e1533719e6931d11480adc4ca28aad5d12f /tests/t-poll.c | |
parent | estream: Track the kind of backend used. (diff) | |
download | libgpg-error-40e5ff0a0084c0d9521b401db4f38885bfdae233.tar.gz libgpg-error-40e5ff0a0084c0d9521b401db4f38885bfdae233.zip |
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 <[email protected]>
Diffstat (limited to 'tests/t-poll.c')
-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 (); |