aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/call-gpg.c8
-rw-r--r--common/exechelp-posix.c20
-rw-r--r--common/exechelp-w32.c20
-rw-r--r--common/exechelp-w32ce.c14
-rw-r--r--common/exechelp.h12
5 files changed, 50 insertions, 24 deletions
diff --git a/common/call-gpg.c b/common/call-gpg.c
index f5a62ecbd..0bda1d391 100644
--- a/common/call-gpg.c
+++ b/common/call-gpg.c
@@ -430,9 +430,9 @@ _gpg_encrypt (ctrl_t ctrl,
assert ((reader_mb == NULL) != (cipher_stream == NULL));
/* Create two pipes. */
- err = gnupg_create_outbound_pipe (outbound_fds);
+ err = gnupg_create_outbound_pipe (outbound_fds, NULL, 0);
if (!err)
- err = gnupg_create_inbound_pipe (inbound_fds);
+ err = gnupg_create_inbound_pipe (inbound_fds, NULL, 0);
if (err)
{
log_error (_("error creating a pipe: %s\n"), gpg_strerror (err));
@@ -614,9 +614,9 @@ _gpg_decrypt (ctrl_t ctrl,
assert ((reader_mb == NULL) != (plain_stream == NULL));
/* Create two pipes. */
- err = gnupg_create_outbound_pipe (outbound_fds);
+ err = gnupg_create_outbound_pipe (outbound_fds, NULL, 0);
if (!err)
- err = gnupg_create_inbound_pipe (inbound_fds);
+ err = gnupg_create_inbound_pipe (inbound_fds, NULL, 0);
if (err)
{
log_error (_("error creating a pipe: %s\n"), gpg_strerror (err));
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);
}
diff --git a/common/exechelp-w32.c b/common/exechelp-w32.c
index 0aa20208e..a8a8b45c5 100644
--- a/common/exechelp-w32.c
+++ b/common/exechelp-w32.c
@@ -320,20 +320,28 @@ do_create_pipe (int filedes[2], int flags)
}
/* 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, INHERIT_WRITE);
+ if (r_fp)
+ return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
+ else
+ return do_create_pipe (filedes, INHERIT_WRITE);
}
/* 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, INHERIT_READ);
+ if (r_fp)
+ return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
+ else
+ return do_create_pipe (filedes, INHERIT_READ);
}
diff --git a/common/exechelp-w32ce.c b/common/exechelp-w32ce.c
index 57ecaf31e..06aa6bcb2 100644
--- a/common/exechelp-w32ce.c
+++ b/common/exechelp-w32ce.c
@@ -450,18 +450,24 @@ create_inheritable_pipe (int filedes[2], int inherit_idx)
/* Portable function to create a pipe. Under Windows the write end is
inheritable (i.e. an rendezvous id). */
gpg_error_t
-gnupg_create_inbound_pipe (int filedes[2])
+gnupg_create_inbound_pipe (int filedes[2], estream_t *r_fp, int nonblock)
{
- return create_inheritable_pipe (filedes, 1);
+ if (r_fp)
+ return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
+ else
+ return create_inheritable_pipe (filedes, 1);
}
/* Portable function to create a pipe. Under Windows the read end is
inheritable (i.e. an rendezvous id). */
gpg_error_t
-gnupg_create_outbound_pipe (int filedes[2])
+gnupg_create_outbound_pipe (int filedes[2], estream_t *r_fp, int nonblock)
{
- return create_inheritable_pipe (filedes, 0);
+ if (r_fp)
+ return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
+ else
+ return create_inheritable_pipe (filedes, 0);
}
diff --git a/common/exechelp.h b/common/exechelp.h
index 3454cd69c..d6ef5f062 100644
--- a/common/exechelp.h
+++ b/common/exechelp.h
@@ -52,12 +52,16 @@ int *get_all_open_fds (void);
/* Portable function to create a pipe. Under Windows the write end is
- inheritable. */
-gpg_error_t gnupg_create_inbound_pipe (int filedes[2]);
+ 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_inbound_pipe (int filedes[2],
+ estream_t *r_fp, int nonblock);
/* Portable function to create a pipe. Under Windows the read end is
- inheritable. */
-gpg_error_t gnupg_create_outbound_pipe (int filedes[2]);
+ 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],
+ estream_t *r_fp, int nonblock);
/* Portable function to create a pipe. Under Windows both ends are
inheritable. */