From 9f4a8d4ea173b4b4cb4d4f06b4004d43e2f4b97a Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 14 Jan 2016 14:14:25 +0100 Subject: common/exechelp: Add general pipe function. * common/exechelp-posix.c (gnupg_create_pipe): New function. * common/exechelp-w32.c (INHERIT_{READ,WRITE,BOTH}): New macros. (create_inheritable_pipe): Generalize so that both ends can be inherited. (do_create_pipe): Rename argument accordingly. (gnupg_create_{in,out}bound_pipe): Use new flags. (gnupg_create_pipe): New function. (gnupg_spawn_process): Use new flags. * common/exechelp-w32ce.c (gnupg_create_pipe): New stub. * common/exechelp.h (gnupg_create_pipe): New prototype. Signed-off-by: Justus Winter --- common/exechelp-posix.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'common/exechelp-posix.c') diff --git a/common/exechelp-posix.c b/common/exechelp-posix.c index 5706dbe1f..37abf55a1 100644 --- a/common/exechelp-posix.c +++ b/common/exechelp-posix.c @@ -310,6 +310,15 @@ gnupg_create_outbound_pipe (int filedes[2]) } +/* Portable function to create a pipe. Under Windows both ends are + inheritable. */ +gpg_error_t +gnupg_create_pipe (int filedes[2]) +{ + return do_create_pipe (filedes); +} + + static gpg_error_t create_pipe_and_estream (int filedes[2], estream_t *r_fp, -- cgit v1.2.3