exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 18c468ee7709966fad4d55c24a58fbe08661d211
parent 5820a6d60cad1a01c23ad4f060aaaf843325f444
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 17 Mar 2026 00:00:22 +0100

remove more legacy GNUNET_OS_process-API calls

Diffstat:
Msrc/testing/test_auditor_api_version.c | 82+++++++++++++++++++++++++++++++++++++++++++++++--------------------------------
Msrc/testing/test_bank_api_twisted.c | 17+++++++++++------
Msrc/testing/test_exchange_api_twisted.c | 15++++++++++-----
Msrc/testing/testing_api_twister_helpers.c | 90+++++++++++++++++++++++++++++++++++++++++++------------------------------------
Msrc/util/test_helper_cs.c | 42+++++++++++++++++++++++-------------------
Msrc/util/test_helper_eddsa.c | 42+++++++++++++++++++++++-------------------
Msrc/util/test_helper_rsa.c | 42+++++++++++++++++++++++-------------------
7 files changed, 188 insertions(+), 142 deletions(-)

diff --git a/src/testing/test_auditor_api_version.c b/src/testing/test_auditor_api_version.c @@ -134,7 +134,7 @@ int main (int argc, char *const *argv) { - struct GNUNET_OS_Process *proc; + struct GNUNET_Process *proc; (void) argc; (void) argv; @@ -144,50 +144,61 @@ main (int argc, GNUNET_log_setup ("test-auditor-api-version", "INFO", NULL); - proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ALL, - NULL, NULL, NULL, - "taler-auditor-dbinit", - "taler-auditor-dbinit", - "-c", CONFIG_FILE, - "-L", "INFO", - NULL); - if (NULL == proc) + proc = GNUNET_process_create (GNUNET_OS_INHERIT_STD_ALL); + if (GNUNET_OK != + GNUNET_process_run_command_va (proc, + "taler-auditor-dbinit", + "taler-auditor-dbinit", + "-c", CONFIG_FILE, + "-L", "INFO", + NULL)) { GNUNET_log ( GNUNET_ERROR_TYPE_ERROR, "Failed to run `taler-auditor-dbinit`, is your PATH correct?\n"); + GNUNET_process_destroy (proc); return 77; } - GNUNET_OS_process_wait (proc); - GNUNET_OS_process_destroy (proc); - proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ALL, - NULL, NULL, NULL, - "taler-exchange-dbinit", - "taler-exchange-dbinit", - "-c", CONFIG_FILE, - "-L", "INFO", - NULL); - if (NULL == proc) + GNUNET_break (GNUNET_OK == + GNUNET_process_wait (proc, + true, + NULL, + NULL)); + GNUNET_process_destroy (proc); + proc = GNUNET_process_create (GNUNET_OS_INHERIT_STD_ALL); + if (GNUNET_OK != + GNUNET_process_run_command_va (proc, + "taler-exchange-dbinit", + "taler-exchange-dbinit", + "-c", CONFIG_FILE, + "-L", "INFO", + NULL)) { GNUNET_log ( GNUNET_ERROR_TYPE_ERROR, "Failed to run `taler-auditor-dbinit`, is your PATH correct?\n"); + GNUNET_process_destroy (proc); return 77; } - GNUNET_OS_process_wait (proc); - GNUNET_OS_process_destroy (proc); - proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ALL, - NULL, NULL, NULL, - "taler-auditor-httpd", - "taler-auditor-httpd", - "-c", CONFIG_FILE, - "-L", "INFO", - NULL); - if (NULL == proc) + GNUNET_break (GNUNET_OK == + GNUNET_process_wait (proc, + true, + NULL, + NULL)); + GNUNET_process_destroy (proc); + proc = GNUNET_process_create (GNUNET_OS_INHERIT_STD_ALL); + if (GNUNET_OK != + GNUNET_process_run_command_va (proc, + "taler-auditor-httpd", + "taler-auditor-httpd", + "-c", CONFIG_FILE, + "-L", "INFO", + NULL)) { GNUNET_log ( GNUNET_ERROR_TYPE_ERROR, "Failed to run `taler-auditor-httpd`, is your PATH correct?\n"); + GNUNET_process_destroy (proc); return 77; } global_ret = TALER_TESTING_wait_httpd_ready ("http://localhost:8083/"); @@ -201,10 +212,15 @@ main (int argc, GNUNET_SCHEDULER_run (&run, NULL); } - GNUNET_OS_process_kill (proc, - SIGTERM); - GNUNET_OS_process_wait (proc); - GNUNET_OS_process_destroy (proc); + GNUNET_break (GNUNET_OK == + GNUNET_process_kill (proc, + SIGTERM)); + GNUNET_break (GNUNET_OK == + GNUNET_process_wait (proc, + true, + NULL, + NULL)); + GNUNET_process_destroy (proc); return global_ret; } diff --git a/src/testing/test_bank_api_twisted.c b/src/testing/test_bank_api_twisted.c @@ -65,7 +65,7 @@ static char *twister_url; /** * Twister process. */ -static struct GNUNET_OS_Process *twisterd; +static struct GNUNET_Process *twisterd; /** @@ -137,12 +137,17 @@ run (void *cls, * @param[in] process process to purge. */ static void -purge_process (struct GNUNET_OS_Process *process) +purge_process (struct GNUNET_Process *process) { - GNUNET_OS_process_kill (process, - SIGINT); - GNUNET_OS_process_wait (process); - GNUNET_OS_process_destroy (process); + GNUNET_break (GNUNET_OK == + GNUNET_process_kill (process, + SIGINT)); + GNUNET_break (GNUNET_OK == + GNUNET_process_wait (process, + true, + NULL, + NULL)); + GNUNET_process_destroy (process); } diff --git a/src/testing/test_exchange_api_twisted.c b/src/testing/test_exchange_api_twisted.c @@ -56,7 +56,7 @@ static char *twister_url; /** * Twister process. */ -static struct GNUNET_OS_Process *twisterd; +static struct GNUNET_Process *twisterd; /** @@ -309,10 +309,15 @@ run (void *cls, static void purge_process (struct GNUNET_OS_Process *process) { - GNUNET_OS_process_kill (process, - SIGINT); - GNUNET_OS_process_wait (process); - GNUNET_OS_process_destroy (process); + GNUNET_break (GNUNET_OK == + GNUNET_process_kill (process, + SIGINT)); + GNUNET_break (GNUNET_OK == + GNUNET_process_wait (process, + true, + NULL, + NULL)); + GNUNET_process_destroy (process); } diff --git a/src/testing/testing_api_twister_helpers.c b/src/testing/testing_api_twister_helpers.c @@ -97,45 +97,50 @@ TALER_TWISTER_run_twister (const char *config_filename) unsigned long code; enum GNUNET_OS_ProcessStatusType type; - proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ALL, - NULL, NULL, NULL, - "taler-twister-service", - "taler-twister-service", - "-c", config_filename, - NULL); - if (NULL == proc) + proc = GNUNET_process_create (GNUNET_OS_INHERIT_STD_ALL); + if (GNUNET_OK != + GNUNET_process_run_command_va (proc, + "taler-twister-service", + "taler-twister-service", + "-c", config_filename, + NULL)) TWISTER_FAIL (); - client_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ALL, - NULL, NULL, NULL, - "taler-twister", - "taler-twister", - "-c", config_filename, - "-a", NULL); - if (NULL == client_proc) + client_proc = GNUNET_process_create (GNUNET_OS_INHERIT_STD_ALL); + if (GNUNET_OK != + GNUNET_process_run_command_va (client_proc, + "taler-twister", + "taler-twister", + "-c", config_filename, + "-a", NULL)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not start the taler-twister client\n"); - GNUNET_break (0 == - GNUNET_OS_process_kill (proc, - SIGTERM)); - GNUNET_OS_process_wait (proc); - GNUNET_OS_process_destroy (proc); + GNUNET_break (GNUNET_OK == + GNUNET_process_kill (proc, + SIGTERM)); + GNUNET_break (GNUNET_OK == + GNUNET_process_wait (proc, + true, + NULL, + NULL)); + GNUNET_process_destroy (proc); TWISTER_FAIL (); } if (GNUNET_SYSERR == - GNUNET_OS_process_wait_status (client_proc, - &type, - &code)) + GNUNET_process_wait (client_proc, + false, + &type, + &code)) { - GNUNET_OS_process_destroy (client_proc); - GNUNET_break (0 == - GNUNET_OS_process_kill (proc, - SIGTERM)); - GNUNET_OS_process_wait (proc); - GNUNET_OS_process_destroy (proc); + GNUNET_process_destroy (client_proc); + GNUNET_break (GNUNET_OK == + GNUNET_process_kill (proc, + SIGTERM)); + GNUNET_process_wait (proc); + GNUNET_process_destroy (proc); TWISTER_FAIL (); } if ( (type == GNUNET_OS_PROCESS_EXITED) && @@ -143,12 +148,12 @@ TALER_TWISTER_run_twister (const char *config_filename) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to check twister works.\n"); - GNUNET_OS_process_destroy (client_proc); - GNUNET_break (0 == - GNUNET_OS_process_kill (proc, - SIGTERM)); - GNUNET_OS_process_wait (proc); - GNUNET_OS_process_destroy (proc); + GNUNET_process_destroy (client_proc); + GNUNET_break (GNUNET_OK == + GNUNET_process_kill (proc, + SIGTERM)); + GNUNET_process_wait (proc); + GNUNET_process_destroy (proc); TWISTER_FAIL (); } if ( (type != GNUNET_OS_PROCESS_EXITED) || @@ -156,15 +161,18 @@ TALER_TWISTER_run_twister (const char *config_filename) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unexpected error running `taler-twister'!\n"); - GNUNET_OS_process_destroy (client_proc); - GNUNET_break (0 == - GNUNET_OS_process_kill (proc, - SIGTERM)); - GNUNET_OS_process_wait (proc); - GNUNET_OS_process_destroy (proc); + GNUNET_process_destroy (client_proc); + GNUNET_break (GNUNET_OK == + GNUNET_process_kill (proc, + SIGTERM)); + GNUNET_process_wait (proc, + true, + NULL, + NULL); + GNUNET_process_destroy (proc); TWISTER_FAIL (); } - GNUNET_OS_process_destroy (client_proc); + GNUNET_process_destroy (client_proc); return proc; } diff --git a/src/util/test_helper_cs.c b/src/util/test_helper_cs.c @@ -1106,7 +1106,7 @@ int main (int argc, const char *const argv[]) { - struct GNUNET_OS_Process *helper; + struct GNUNET_Process *helper; char *libexec_dir; char *binary_name; int ret; @@ -1128,37 +1128,41 @@ main (int argc, libexec_dir, "taler-exchange-secmod-cs"); GNUNET_free (libexec_dir); - helper = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ERR, - NULL, NULL, NULL, - binary_name, - binary_name, - "-c", - "test_helper_cs.conf", - "-L", - loglev, - NULL); - if (NULL == helper) + helper = GNUNET_process_create (GNUNET_OS_INHERIT_STD_ERR); + if (GNUNET_OK != + GNUNET_process_run_command (helper, + binary_name, + binary_name, + "-c", + "test_helper_cs.conf", + "-L", + loglev, + NULL)) { GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "exec", binary_name); + GNUNET_process_destroy (helper); GNUNET_free (binary_name); return 77; } GNUNET_free (binary_name); ret = run_test (); - GNUNET_OS_process_kill (helper, - SIGTERM); + GNUNET_break (GNUNET_OK == + GNUNET_process_kill (helper, + SIGTERM)); if (GNUNET_OK != - GNUNET_OS_process_wait_status (helper, - &type, - &code)) + GNUNET_process_wait_status (helper, + false, + &type, + &code)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Helper process did not die voluntarily, killing hard\n"); - GNUNET_OS_process_kill (helper, - SIGKILL); + GNUNET_break (GNUNET_OK == + GNUNET_process_kill (helper, + SIGKILL)); ret = 4; } else if ( (GNUNET_OS_PROCESS_EXITED != type) || @@ -1170,7 +1174,7 @@ main (int argc, (int) code); ret = 5; } - GNUNET_OS_process_destroy (helper); + GNUNET_process_destroy (helper); return ret; } diff --git a/src/util/test_helper_eddsa.c b/src/util/test_helper_eddsa.c @@ -485,7 +485,7 @@ int main (int argc, const char *const argv[]) { - struct GNUNET_OS_Process *helper; + struct GNUNET_Process *helper; char *libexec_dir; char *binary_name; int ret; @@ -506,37 +506,41 @@ main (int argc, libexec_dir, "taler-exchange-secmod-eddsa"); GNUNET_free (libexec_dir); - helper = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ERR, - NULL, NULL, NULL, - binary_name, - binary_name, - "-c", - "test_helper_eddsa.conf", - "-L", - "INFO", - NULL); - if (NULL == helper) + helper = GNUNET_process_create (GNUNET_OS_INHERIT_STD_ERR); + if (GNUNET_OK != + GNUNET_process_run_command_va (helper, + binary_name, + binary_name, + "-c", + "test_helper_eddsa.conf", + "-L", + "INFO", + NULL)) { GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "exec", binary_name); + GNUNET_process_destroy (helper); GNUNET_free (binary_name); return 77; } GNUNET_free (binary_name); ret = run_test (); - GNUNET_OS_process_kill (helper, - SIGTERM); + GNUNET_break (GNUNET_OK == + GNUNET_process_kill (helper, + SIGTERM)); if (GNUNET_OK != - GNUNET_OS_process_wait_status (helper, - &type, - &code)) + GNUNET_process_wait (helper, + false, + &type, + &code)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Helper process did not die voluntarily, killing hard\n"); - GNUNET_OS_process_kill (helper, - SIGKILL); + GNUNET_break (GNUNET_OK == + GNUNET_process_kill (helper, + SIGKILL)); ret = 4; } else if ( (GNUNET_OS_PROCESS_EXITED != type) || @@ -548,7 +552,7 @@ main (int argc, (int) code); ret = 5; } - GNUNET_OS_process_destroy (helper); + GNUNET_process_destroy (helper); return ret; } diff --git a/src/util/test_helper_rsa.c b/src/util/test_helper_rsa.c @@ -932,7 +932,7 @@ main (int argc, const char *const argv[]) { const char *loglevel = "WARNING"; - struct GNUNET_OS_Process *helper; + struct GNUNET_Process *helper; char *libexec_dir; char *binary_name; int ret; @@ -953,17 +953,18 @@ main (int argc, libexec_dir, "taler-exchange-secmod-rsa"); GNUNET_free (libexec_dir); - helper = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ERR, - NULL, NULL, NULL, - binary_name, - binary_name, - "-c", - "test_helper_rsa.conf", - "-L", - loglevel, - NULL); - if (NULL == helper) + helper = GNUNET_process_create (GNUNET_OS_INHERIT_STD_ERR); + if (GNUNET_OK != + GNUNET_process_run_command_va (helper, + binary_name, + binary_name, + "-c", + "test_helper_rsa.conf", + "-L", + loglevel, + NULL)) { + GNUNET_process_destroy (helper); GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "exec", binary_name); @@ -973,17 +974,20 @@ main (int argc, GNUNET_free (binary_name); ret = run_test (); - GNUNET_OS_process_kill (helper, - SIGTERM); + GNUNET_break (GNUNET_OK == + GNUNET_process_kill (helper, + SIGTERM)); if (GNUNET_OK != - GNUNET_OS_process_wait_status (helper, - &type, - &code)) + GNUNET_process_wait (helper, + false, + &type, + &code)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Helper process did not die voluntarily, killing hard\n"); - GNUNET_OS_process_kill (helper, - SIGKILL); + GNUNET_break (GNUNET_OK == + GNUNET_process_kill (helper, + SIGKILL)); ret = 4; } else if ( (GNUNET_OS_PROCESS_EXITED != type) || @@ -995,7 +999,7 @@ main (int argc, (int) code); ret = 5; } - GNUNET_OS_process_destroy (helper); + GNUNET_process_destroy (helper); return ret; }