aboutsummaryrefslogtreecommitdiffstats
path: root/common/exechelp-posix.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-05-27 13:41:55 +0000
committerWerner Koch <[email protected]>2016-05-27 13:41:55 +0000
commit5d991e333a1885adc40abd9d00c01fec4bd5d9d7 (patch)
treed685d34bc855b0f2290502dd7dacb96690d1632d /common/exechelp-posix.c
parentcommon: Make use of default_errsource in exechelp. (diff)
downloadgnupg-5d991e333a1885adc40abd9d00c01fec4bd5d9d7.tar.gz
gnupg-5d991e333a1885adc40abd9d00c01fec4bd5d9d7.zip
common: Extend gnupg_create_inbound_pipe et al.
* common/exechelp-posix.c (gnupg_create_inbound_pipe): Add args 'r_fp' and 'nonblock'. (gnupg_create_outbound_pipe): Ditto. * common/exechelp-w32.c (gnupg_create_inbound_pipe): Add non yet functional args 'r_fp' and 'nonblock'. (gnupg_create_outbound_pipe): Ditto. * common/exechelp-w32ce.c (gnupg_create_inbound_pipe): Ditto. (gnupg_create_outbound_pipe): Ditto. -- Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'common/exechelp-posix.c')
-rw-r--r--common/exechelp-posix.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/common/exechelp-posix.c b/common/exechelp-posix.c
index 069b07a4b..87c6e5509 100644
--- a/common/exechelp-posix.c
+++ b/common/exechelp-posix.c
@@ -341,20 +341,28 @@ create_pipe_and_estream (int filedes[2], estream_t *r_fp,
/* Portable function to create a pipe. Under Windows the write end is
- inheritable. */
+ inheritable. If R_FP is not NULL, an estream is created for the
+ read end and stored at R_FP. */
gpg_error_t
-gnupg_create_inbound_pipe (int filedes[2])
+gnupg_create_inbound_pipe (int filedes[2], estream_t *r_fp, int nonblock)
{
- return do_create_pipe (filedes);
+ if (r_fp)
+ return create_pipe_and_estream (filedes, r_fp, 0, nonblock);
+ else
+ return do_create_pipe (filedes);
}
/* Portable function to create a pipe. Under Windows the read end is
- inheritable. */
+ inheritable. If R_FP is not NULL, an estream is created for the
+ write end and stored at R_FP. */
gpg_error_t
-gnupg_create_outbound_pipe (int filedes[2])
+gnupg_create_outbound_pipe (int filedes[2], estream_t *r_fp, int nonblock)
{
- return do_create_pipe (filedes);
+ if (r_fp)
+ return create_pipe_and_estream (filedes, r_fp, 1, nonblock);
+ else
+ return do_create_pipe (filedes);
}