aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-06-25 18:25:28 +0000
committerWerner Koch <[email protected]>2014-06-26 08:42:56 +0000
commit68116fa5f67238a60bb8be375cc959262fa021d3 (patch)
tree86527b59bb10705c17c3f654eab582f02274d9ee
parentw32: Add comment about a compiler warning (diff)
downloadgpgme-68116fa5f67238a60bb8be375cc959262fa021d3.tar.gz
gpgme-68116fa5f67238a60bb8be375cc959262fa021d3.zip
w32: Get IOSPAWN flag back in sync with spawn helper.
* src/gpgme-w32spawn.c: Include priv-io.h.
-rw-r--r--src/gpgme-w32spawn.c25
-rw-r--r--src/priv-io.h1
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 <stdint.h>
#include <process.h>
-#include <windows.h>
-/* 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 <winsock2.h>
# include <windows.h>
#else
# include <sys/socket.h>