From 8b1f35a78f01cae97ddfe52708743d07ed42b07f Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 23 Jul 2024 13:53:20 +0200 Subject: [PATCH] g13: Finish migration to gpgrt_process_spawn API -- Fixes-commit: 953dd67368ceaeb8b42cfb8f9b5f3c4de8afdbe0 --- g13/runner.c | 18 +++++++++--------- g13/runner.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/g13/runner.c b/g13/runner.c index 19ed46f52..8f4ca9ecf 100644 --- a/g13/runner.c +++ b/g13/runner.c @@ -54,7 +54,7 @@ struct runner_s 2 = Thread is running and someone is holding a reference. */ int refcount; - gnupg_process_t proc; /* Process of the backend's process (the engine). */ + gpgrt_process_t proc; /* Process of the backend's process (the engine). */ int in_fd; /* File descriptors to read from the engine. */ int out_fd; /* File descriptors to write to the engine. */ engine_handler_fnc_t handler; /* The handler functions. */ @@ -159,13 +159,13 @@ runner_release (runner_t runner) if (runner->proc) { /* The process has not been cleaned up - do it now. */ - gnupg_process_terminate (runner->proc); + gpgrt_process_terminate (runner->proc); /* (Actually we should use the program name and not the arbitrary NAME of the runner object. However it does not matter because that information is only used for diagnostics.) */ - gnupg_process_wait (runner->proc, 1); - gnupg_process_release (runner->proc); + gpgrt_process_wait (runner->proc, 1); + gpgrt_process_release (runner->proc); } xfree (runner->name); @@ -268,7 +268,7 @@ runner_set_fds (runner_t runner, int in_fd, int out_fd) /* Set the PROC of the backend engine. After this call the engine is owned by the runner object. */ void -runner_set_proc (runner_t runner, gnupg_process_t proc) +runner_set_proc (runner_t runner, gpgrt_process_t proc) { if (check_already_spawned (runner, "runner_set_proc")) return; @@ -370,10 +370,10 @@ runner_thread (void *arg) int exitcode; log_debug ("runner thread waiting ...\n"); - err = gnupg_process_wait (runner->proc, 1); + err = gpgrt_process_wait (runner->proc, 1); if (!err) - gnupg_process_ctl (runner->proc, GNUPG_PROCESS_GET_EXIT_ID, &exitcode); - gnupg_process_release (runner->proc); + gpgrt_process_ctl (runner->proc, GPGRT_PROCESS_GET_EXIT_ID, &exitcode); + gpgrt_process_release (runner->proc); runner->proc = NULL; if (exitcode) log_error ("running '%s' failed (exitcode=%d): %s\n", @@ -474,7 +474,7 @@ runner_cancel (runner_t runner) need to change the thread to wait on an event. */ runner->cancel_flag = 1; /* For now we use the brutal way and kill the process. */ - gnupg_process_terminate (runner->proc); + gpgrt_process_terminate (runner->proc); } } diff --git a/g13/runner.h b/g13/runner.h index 01c395e02..c867ba7e7 100644 --- a/g13/runner.h +++ b/g13/runner.h @@ -49,7 +49,7 @@ runner_t runner_find_by_rid (unsigned int rid); /* Functions to set properties of the runner. */ void runner_set_fds (runner_t runner, int in_fd, int out_fd); -void runner_set_proc (runner_t runner, gnupg_process_t proc); +void runner_set_proc (runner_t runner, gpgrt_process_t proc); /* Register the handler functions with a runner. */ void runner_set_handler (runner_t runner,