summaryrefslogtreecommitdiffstats
path: root/common/exechelp-w32.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-09-02 14:49:24 +0200
committerWerner Koch <wk@gnupg.org>2020-09-02 14:49:24 +0200
commit2042f5a4641f4e43137b7683077b4d733d216417 (patch)
treed373159c268ce4370f8a1825c87f7ae39d4798c8 /common/exechelp-w32.c
parentUse only one copy of the warn_server_mismatch function. (diff)
downloadgnupg2-2042f5a4641f4e43137b7683077b4d733d216417.tar.xz
gnupg2-2042f5a4641f4e43137b7683077b4d733d216417.zip
common: New helper function gnupg_close_pipe.
* common/exechelp-posix.c (gnupg_close_pipe): New. * common/exechelp-w32.c (gnupg_close_pipe): New. -- This function is mainly for documentation purposes and should be used along with gnupg_create_pipe. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'common/exechelp-w32.c')
-rw-r--r--common/exechelp-w32.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/exechelp-w32.c b/common/exechelp-w32.c
index ea158a33f..be684caaa 100644
--- a/common/exechelp-w32.c
+++ b/common/exechelp-w32.c
@@ -397,6 +397,15 @@ gnupg_create_pipe (int filedes[2])
}
+/* Close the end of a pipe. */
+void
+gnupg_close_pipe (int fd)
+{
+ if (fd != -1)
+ close (fd);
+}
+
+
/* Fork and exec the PGMNAME, see exechelp.h for details. */
gpg_error_t
gnupg_spawn_process (const char *pgmname, const char *argv[],