mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-21 10:09:57 +01:00
g13: Finish migration to gpgrt_process_spawn API
-- Fixes-commit: 953dd67368ceaeb8b42cfb8f9b5f3c4de8afdbe0
This commit is contained in:
parent
62384ba556
commit
8b1f35a78f
18
g13/runner.c
18
g13/runner.c
@ -54,7 +54,7 @@ struct runner_s
|
|||||||
2 = Thread is running and someone is holding a reference. */
|
2 = Thread is running and someone is holding a reference. */
|
||||||
int refcount;
|
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 in_fd; /* File descriptors to read from the engine. */
|
||||||
int out_fd; /* File descriptors to write to the engine. */
|
int out_fd; /* File descriptors to write to the engine. */
|
||||||
engine_handler_fnc_t handler; /* The handler functions. */
|
engine_handler_fnc_t handler; /* The handler functions. */
|
||||||
@ -159,13 +159,13 @@ runner_release (runner_t runner)
|
|||||||
if (runner->proc)
|
if (runner->proc)
|
||||||
{
|
{
|
||||||
/* The process has not been cleaned up - do it now. */
|
/* 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
|
/* (Actually we should use the program name and not the
|
||||||
arbitrary NAME of the runner object. However it does not
|
arbitrary NAME of the runner object. However it does not
|
||||||
matter because that information is only used for
|
matter because that information is only used for
|
||||||
diagnostics.) */
|
diagnostics.) */
|
||||||
gnupg_process_wait (runner->proc, 1);
|
gpgrt_process_wait (runner->proc, 1);
|
||||||
gnupg_process_release (runner->proc);
|
gpgrt_process_release (runner->proc);
|
||||||
}
|
}
|
||||||
|
|
||||||
xfree (runner->name);
|
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
|
/* Set the PROC of the backend engine. After this call the engine is
|
||||||
owned by the runner object. */
|
owned by the runner object. */
|
||||||
void
|
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"))
|
if (check_already_spawned (runner, "runner_set_proc"))
|
||||||
return;
|
return;
|
||||||
@ -370,10 +370,10 @@ runner_thread (void *arg)
|
|||||||
int exitcode;
|
int exitcode;
|
||||||
|
|
||||||
log_debug ("runner thread waiting ...\n");
|
log_debug ("runner thread waiting ...\n");
|
||||||
err = gnupg_process_wait (runner->proc, 1);
|
err = gpgrt_process_wait (runner->proc, 1);
|
||||||
if (!err)
|
if (!err)
|
||||||
gnupg_process_ctl (runner->proc, GNUPG_PROCESS_GET_EXIT_ID, &exitcode);
|
gpgrt_process_ctl (runner->proc, GPGRT_PROCESS_GET_EXIT_ID, &exitcode);
|
||||||
gnupg_process_release (runner->proc);
|
gpgrt_process_release (runner->proc);
|
||||||
runner->proc = NULL;
|
runner->proc = NULL;
|
||||||
if (exitcode)
|
if (exitcode)
|
||||||
log_error ("running '%s' failed (exitcode=%d): %s\n",
|
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. */
|
need to change the thread to wait on an event. */
|
||||||
runner->cancel_flag = 1;
|
runner->cancel_flag = 1;
|
||||||
/* For now we use the brutal way and kill the process. */
|
/* For now we use the brutal way and kill the process. */
|
||||||
gnupg_process_terminate (runner->proc);
|
gpgrt_process_terminate (runner->proc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ runner_t runner_find_by_rid (unsigned int rid);
|
|||||||
/* Functions to set properties of the runner. */
|
/* Functions to set properties of the runner. */
|
||||||
void runner_set_fds (runner_t runner, int in_fd, int out_fd);
|
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. */
|
/* Register the handler functions with a runner. */
|
||||||
void runner_set_handler (runner_t runner,
|
void runner_set_handler (runner_t runner,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user