diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-02-28 15:48:43 +0100 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-02-28 15:48:43 +0100 |
commit | 5422937e5655f46586be99a019c4308a7c69f66f (patch) | |
tree | c266ba7b7943ce255b1eb0c56a91044d7422e801 /src | |
parent | ae2951782dd9097e413271bff60c3e2ea6ef1327 (diff) | |
download | merchant-5422937e5655f46586be99a019c4308a7c69f66f.tar.gz merchant-5422937e5655f46586be99a019c4308a7c69f66f.tar.bz2 merchant-5422937e5655f46586be99a019c4308a7c69f66f.zip |
convenience function to kill+wait+destroy processes.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/test_merchant_api_twisted.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/lib/test_merchant_api_twisted.c b/src/lib/test_merchant_api_twisted.c index e9685f36..428bb9ca 100644 --- a/src/lib/test_merchant_api_twisted.c +++ b/src/lib/test_merchant_api_twisted.c @@ -635,6 +635,19 @@ run (void *cls, fakebank_url); } +/** + * Kill, wait, and destroy convenience function. + * + * @param process process to purge. + */ +static void +purge_process (struct GNUNET_OS_Process *process) +{ + GNUNET_OS_process_kill (process, SIGKILL); + GNUNET_OS_process_wait (process); + GNUNET_OS_process_destroy (process); +} + int main (int argc, char * const *argv) @@ -675,9 +688,7 @@ main (int argc, ret = TALER_TESTING_setup_with_exchange (&run, NULL, CONFIG_FILE); - GNUNET_OS_process_kill (merchantd, SIGKILL); - GNUNET_OS_process_wait (merchantd); - GNUNET_OS_process_destroy (merchantd); + purge_process (merchantd); GNUNET_free (merchant_url); if (GNUNET_OK != ret) |