summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/assuan-defs.h3
-rw-r--r--src/assuan-pipe-connect.c10
-rw-r--r--src/assuan-socket-connect.c12
-rw-r--r--src/system-w32.c2
4 files changed, 17 insertions, 10 deletions
diff --git a/src/assuan-defs.h b/src/assuan-defs.h
index 68bd983..0cdb08d 100644
--- a/src/assuan-defs.h
+++ b/src/assuan-defs.h
@@ -180,6 +180,9 @@ struct assuan_context_s
int max_accepts; /* If we can not handle more than one connection,
set this to 1, otherwise to -1. */
pid_t pid; /* The pid of the peer. */
+#if defined(HAVE_W64_SYSTEM) || defined(HAVE_W32_SYSTEM)
+ int process_handle; /* process handle of the server for FD passing. */
+#endif
assuan_fd_t listen_fd; /* The fd we are listening on (used by
socket servers) */
assuan_sock_nonce_t listen_nonce; /* Used with LISTEN_FD. */
diff --git a/src/assuan-pipe-connect.c b/src/assuan-pipe-connect.c
index fc56334..17d3c95 100644
--- a/src/assuan-pipe-connect.c
+++ b/src/assuan-pipe-connect.c
@@ -106,9 +106,9 @@ initial_handshake (assuan_context_t ctx)
"can't connect server: %s", gpg_strerror (err));
else if (response == ASSUAN_RESPONSE_OK)
{
-#ifdef HAVE_W32_SYSTEM
+#if defined(HAVE_W64_SYSTEM) || defined(HAVE_W32_SYSTEM)
const char *line = ctx->inbound.line + off;
- int pid = ASSUAN_INVALID_PID;
+ int process_handle = ASSUAN_INVALID_PID;
/* Parse the message: OK ..., process %i */
line = strchr (line, ',');
@@ -119,11 +119,11 @@ initial_handshake (assuan_context_t ctx)
{
line = strchr (line + 1, ' ');
if (line)
- pid = atoi (line + 1);
+ process_handle = atoi (line + 1);
}
}
- if (pid != ASSUAN_INVALID_PID)
- ctx->pid = pid;
+ if (process_handle != ASSUAN_INVALID_PID)
+ ctx->process_handle = process_handle;
#else
;
#endif
diff --git a/src/assuan-socket-connect.c b/src/assuan-socket-connect.c
index 457edfe..629399e 100644
--- a/src/assuan-socket-connect.c
+++ b/src/assuan-socket-connect.c
@@ -133,8 +133,9 @@ _assuan_connect_finalize (assuan_context_t ctx, assuan_fd_t fd,
"can't connect to server: %s\n", gpg_strerror (err));
else if (response == ASSUAN_RESPONSE_OK)
{
+#if defined(HAVE_W64_SYSTEM) || defined(HAVE_W32_SYSTEM)
const char *line = ctx->inbound.line + off;
- int pid = ASSUAN_INVALID_PID;
+ int process_handle = ASSUAN_INVALID_PID;
/* Parse the message: OK ..., process %i */
line = strchr (line, ',');
@@ -145,11 +146,14 @@ _assuan_connect_finalize (assuan_context_t ctx, assuan_fd_t fd,
{
line = strchr (line + 1, ' ');
if (line)
- pid = atoi (line + 1);
+ process_handle = atoi (line + 1);
}
}
- if (pid != ASSUAN_INVALID_PID)
- ctx->pid = pid;
+ if (process_handle != ASSUAN_INVALID_PID)
+ ctx->process_handle = process_handle;
+#else
+ ;
+#endif
}
else
{
diff --git a/src/system-w32.c b/src/system-w32.c
index 76ff2a0..0d6681f 100644
--- a/src/system-w32.c
+++ b/src/system-w32.c
@@ -205,7 +205,7 @@ w32_fdpass_send (assuan_context_t ctx, assuan_fd_t fd)
fd_converted_to_integer = (intptr_t)fd;
fd0 = (int)fd_converted_to_integer; /* Bit pattern is possibly truncated. */
- err = get_file_handle (fd0, ctx->pid, &file_handle);
+ err = get_file_handle (fd0, ctx->process_handle, &file_handle);
if (err)
return err;