From 721e49caeea6ba5073f8bc5c6c08359295c02bb5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 3 Nov 2010 21:26:40 +0000 Subject: original patch from Mantis 1614 --- src/peerinfo/test_peerinfo_api.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/peerinfo/test_peerinfo_api.c') diff --git a/src/peerinfo/test_peerinfo_api.c b/src/peerinfo/test_peerinfo_api.c index 34655c893..b2e95d767 100644 --- a/src/peerinfo/test_peerinfo_api.c +++ b/src/peerinfo/test_peerinfo_api.c @@ -165,7 +165,7 @@ static int check () { int ok = 3; - pid_t pid; + GNUNET_OS_Process *proc; char *const argv[] = { "test-peerinfo-api", "-c", "test_peerinfo_api_data.conf", @@ -177,7 +177,7 @@ check () struct GNUNET_GETOPT_CommandLineOption options[] = { GNUNET_GETOPT_OPTION_END }; - pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-peerinfo", + proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-peerinfo", "gnunet-service-peerinfo", #if DEBUG_PEERINFO "-L", "DEBUG", @@ -186,12 +186,14 @@ check () GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, "test-peerinfo-api", "nohelp", options, &run, &ok); - if (0 != PLIBC_KILL (pid, SIGTERM)) + if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); ok = 1; } - GNUNET_OS_process_wait(pid); + GNUNET_OS_process_wait (proc); + GNUNET_OS_process_close (proc); + proc = NULL; return ok; } -- cgit v1.2.3