From 68116fa5f67238a60bb8be375cc959262fa021d3 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 25 Jun 2014 20:25:28 +0200 Subject: [PATCH] w32: Get IOSPAWN flag back in sync with spawn helper. * src/gpgme-w32spawn.c: Include priv-io.h. --- src/gpgme-w32spawn.c | 25 +++++++------------------ src/priv-io.h | 1 + 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/gpgme-w32spawn.c b/src/gpgme-w32spawn.c index 8a4ab544..b510ba3a 100644 --- a/src/gpgme-w32spawn.c +++ b/src/gpgme-w32spawn.c @@ -36,10 +36,8 @@ #endif #include #include -#include -/* Flag values as used by gpgme. */ -#define IOSPAWN_FLAG_ALLOW_SET_FG 1 +#include "priv-io.h" /* Name of this program. */ @@ -47,15 +45,6 @@ -struct spawn_fd_item_s -{ - int handle; - int dup_to; - int peer_name; - int arg_loc; -}; - - static char * build_commandline (char **argv) { @@ -160,7 +149,7 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags) fprintf (stderr, PGM": spawning: %s\n", arg_string); - for (i = 0; fd_list[i].handle != -1; i++) + for (i = 0; fd_list[i].fd != -1; i++) { /* The handle already is inheritable. */ if (fd_list[i].dup_to == 0) @@ -240,8 +229,8 @@ my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags) if (hnul != INVALID_HANDLE_VALUE) CloseHandle (hnul); - for (i = 0; fd_list[i].handle != -1; i++) - CloseHandle ((HANDLE) fd_list[i].handle); + for (i = 0; fd_list[i].fd != -1; i++) + CloseHandle ((HANDLE) fd_list[i].fd); if (flags & IOSPAWN_FLAG_ALLOW_SET_FG) { @@ -379,12 +368,12 @@ translate_get_from_file (const char *trans_file, break; linep = tail; - fd_list[idx].handle = from; + fd_list[idx].fd = from; fd_list[idx].dup_to = dup_to; fd_list[idx].peer_name = to; fd_list[idx].arg_loc = loc; } - fd_list[idx].handle = -1; + fd_list[idx].fd = -1; fd_list[idx].dup_to = -1; fd_list[idx].peer_name = -1; fd_list[idx].arg_loc = 0; @@ -420,7 +409,7 @@ translate_handles (const char *trans_file, const char * const *argv, args[idx] = NULL; n_args = idx; - for (idx = 0; fd_list[idx].handle != -1; idx++) + for (idx = 0; fd_list[idx].fd != -1; idx++) { char buf[25]; int aidx; diff --git a/src/priv-io.h b/src/priv-io.h index 583f06ad..23061756 100644 --- a/src/priv-io.h +++ b/src/priv-io.h @@ -26,6 +26,7 @@ # ifdef HAVE_W32CE_SYSTEM # include "w32-ce.h" # endif +# include # include #else # include