[Pkg-gnupg-commit] [gnupg2] 129/292: common, w32: Communicate with child in non-blocking mode.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Mon Nov 21 06:31:33 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit 05a1e412332dd980353a4e3e59bc75ba40bae7fc
Author: Justus Winter <justus at g10code.com>
Date:   Tue Oct 18 14:04:54 2016 +0200

    common,w32: Communicate with child in non-blocking mode.
    
    * common/exechelp-w32.c (gnupg_spawn_process): Open streams in
    non-blocking mode if requested.
    
    Fixes-commit: 83811e3f1f0c615b2b63bafdb49a35a0fc198088
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 common/exechelp-w32.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/common/exechelp-w32.c b/common/exechelp-w32.c
index c5d6b08..19e4d9e 100644
--- a/common/exechelp-w32.c
+++ b/common/exechelp-w32.c
@@ -418,6 +418,7 @@ gnupg_spawn_process (const char *pgmname, const char *argv[],
   int i;
   es_syshd_t syshd;
   gpg_err_source_t errsource = default_errsource;
+  int nonblock = !!(flags & GNUPG_SPAWN_NONBLOCK);
 
   (void)except; /* Not yet used.  */
 
@@ -440,7 +441,7 @@ gnupg_spawn_process (const char *pgmname, const char *argv[],
 
       syshd.type = ES_SYSHD_HANDLE;
       syshd.u.handle = inpipe[1];
-      infp = es_sysopen (&syshd, "w");
+      infp = es_sysopen (&syshd, nonblock? "w,nonblock" : "w");
       if (!infp)
         {
           err = gpg_err_make (errsource, gpg_err_code_from_syserror ());
@@ -464,7 +465,7 @@ gnupg_spawn_process (const char *pgmname, const char *argv[],
 
       syshd.type = ES_SYSHD_HANDLE;
       syshd.u.handle = outpipe[0];
-      outfp = es_sysopen (&syshd, "r");
+      outfp = es_sysopen (&syshd, nonblock? "r,nonblock" : "r");
       if (!outfp)
         {
           err = gpg_err_make (errsource, gpg_err_code_from_syserror ());
@@ -494,7 +495,7 @@ gnupg_spawn_process (const char *pgmname, const char *argv[],
 
       syshd.type = ES_SYSHD_HANDLE;
       syshd.u.handle = errpipe[0];
-      errfp = es_sysopen (&syshd, "r");
+      errfp = es_sysopen (&syshd, nonblock? "r,nonblock" : "r");
       if (!errfp)
         {
           err = gpg_err_make (errsource, gpg_err_code_from_syserror ());

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list