summaryrefslogtreecommitdiffstats
path: root/debian/patches/from-master/common-Fix-the-previous-commit.patch
blob: c62f52143c4d69008051f95161acf2a1778e1455 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From: NIIBE Yutaka <gniibe@fsij.org>
Date: Wed, 24 Jul 2019 15:32:13 +0900
Subject: common: Fix the previous commit.

* common/asshelp.c [HAVE_W32_SYSTEM] (start_new_gpg_agent): Use
gnupg_spawn_process_detached.
(start_new_dirmngr): Likewise.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit 044379772fc5b0f39c6a36809722e702808b6ec3)
---
 common/asshelp.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/common/asshelp.c b/common/asshelp.c
index 73f159d..9f269ab 100644
--- a/common/asshelp.c
+++ b/common/asshelp.c
@@ -477,6 +477,10 @@ start_new_gpg_agent (assuan_context_t *r_ctx,
       if (!(err = lock_spawning (&lock, gnupg_homedir (), "agent", verbose))
           && assuan_socket_connect (ctx, sockname, 0, 0))
         {
+#ifdef HAVE_W32_SYSTEM
+          err = gnupg_spawn_process_detached (program? program : agent_program,
+                                              argv, NULL);
+#else
           pid_t pid;
 
           err = gnupg_spawn_process_fd (program? program : agent_program,
@@ -484,6 +488,7 @@ start_new_gpg_agent (assuan_context_t *r_ctx,
           if (!err)
             err = gnupg_wait_process (program? program : agent_program,
                                       pid, 1, NULL);
+#endif
           if (err)
             log_error ("failed to start agent '%s': %s\n",
                        agent_program, gpg_strerror (err));
@@ -617,12 +622,16 @@ start_new_dirmngr (assuan_context_t *r_ctx,
       if (!(err = lock_spawning (&lock, gnupg_homedir (), "dirmngr", verbose))
           && assuan_socket_connect (ctx, sockname, 0, 0))
         {
+#ifdef HAVE_W32_SYSTEM
+          err = gnupg_spawn_process_detached (dirmngr_program, argv, NULL);
+#else
           pid_t pid;
 
           err = gnupg_spawn_process_fd (dirmngr_program, argv,
                                         -1, -1, -1, &pid);
           if (!err)
             err = gnupg_wait_process (dirmngr_program, pid, 1, NULL);
+#endif
           if (err)
             log_error ("failed to start the dirmngr '%s': %s\n",
                        dirmngr_program, gpg_strerror (err));