w32: Make pipes really pollable.
authorWerner Koch <wk@gnupg.org>
Tue, 28 Feb 2017 08:34:29 +0000 (09:34 +0100)
committerWerner Koch <wk@gnupg.org>
Tue, 28 Feb 2017 08:39:10 +0000 (09:39 +0100)
commit1192449207f41b26be8950b04df84a52c8a2a886
tree66bc2f2e39c4f1be9cb39fea9225d8a07db0f6c9
parentf5782e11a560fd590221042391254c810a42e45f
w32: Make pipes really pollable.

* common/exectool.c (gnupg_exec_tool_stream) [W32]: Use _get_osfhandle
to print the fd for the command line.
* common/exechelp-w32.c (create_pipe_and_estream): Use es_sysopen so
that the streams are actually pollable.
--

This addresses two bugs:

 - Using the "-&@INEXTRA@" kludges requires that we pass the value of
   the handle on the command line and not the libc fd.

 - gpgrt_poll requires the use of the ReadFile/WriteFile backend which
   is currently only used when the stream has been created with
   gpgrt_sysopen.

Signed-off-by: Werner Koch <wk@gnupg.org>
common/exechelp-w32.c
common/exectool.c