aboutsummaryrefslogtreecommitdiffstats
path: root/src/assuan-pipe-server.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/assuan-pipe-server.c')
-rw-r--r--src/assuan-pipe-server.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/assuan-pipe-server.c b/src/assuan-pipe-server.c
index ba269b0..7b2d643 100644
--- a/src/assuan-pipe-server.c
+++ b/src/assuan-pipe-server.c
@@ -69,7 +69,6 @@ _assuan_new_context (ASSUAN_CONTEXT *r_ctx)
ctx->io = &io;
ctx->listen_fd = -1;
- ctx->client_pid = (pid_t)-1;
/* Use the pipe server handler as a default. */
ctx->deinit_handler = deinit_pipe_server;
ctx->accept_handler = accept_connection;
@@ -94,11 +93,20 @@ assuan_init_pipe_server (ASSUAN_CONTEXT *r_ctx, int filedes[2])
if (!rc)
{
ASSUAN_CONTEXT ctx = *r_ctx;
+ const char *s;
+ unsigned long ul;
ctx->is_server = 1;
ctx->inbound.fd = filedes[0];
ctx->outbound.fd = filedes[1];
ctx->pipe_mode = 1;
+
+ s = getenv ("_assuan_pipe_connect_pid");
+ if (s && (ul=strtoul (s, NULL, 10)) && ul)
+ ctx->pid = (pid_t)ul;
+ else
+ ctx->pid = (pid_t)-1;
+
}
return rc;
}