aboutsummaryrefslogtreecommitdiff
path: root/src/statistics
diff options
context:
space:
mode:
authorgrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2010-11-03 21:26:40 +0000
committergrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2010-11-03 21:26:40 +0000
commit23f8ad972fba676ee8cc90aca9a057f9c0f1235e (patch)
treee06e80ba90af91e9452a48a7a5782913199b4877 /src/statistics
parentdd37ffefbb3ae23b2384ef535b2ec394228ac5dc (diff)
original patch from Mantis 1614
git-svn-id: https://gnunet.org/svn/gnunet@13540 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/statistics')
-rw-r--r--src/statistics/test_statistics_api.c20
-rw-r--r--src/statistics/test_statistics_api_loop.c10
2 files changed, 18 insertions, 12 deletions
diff --git a/src/statistics/test_statistics_api.c b/src/statistics/test_statistics_api.c
index 5c55a11a6b..6a45e3b102 100644
--- a/src/statistics/test_statistics_api.c
+++ b/src/statistics/test_statistics_api.c
@@ -29,7 +29,7 @@
#include "gnunet_scheduler_lib.h"
#include "gnunet_statistics_service.h"
-#define DEBUG_STATISTICS GNUNET_NO
+#define DEBUG_STATISTICS GNUNET_YES
#define START_SERVICE GNUNET_YES
@@ -157,8 +157,8 @@ check ()
GNUNET_GETOPT_OPTION_END
};
#if START_SERVICE
- pid_t pid;
- pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-statistics",
+ GNUNET_OS_Process *proc;
+ proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-statistics",
"gnunet-service-statistics",
#if DEBUG_STATISTICS
"-L", "DEBUG",
@@ -168,19 +168,21 @@ check ()
GNUNET_PROGRAM_run (5, argv, "test-statistics-api", "nohelp",
options, &run, &ok);
#if START_SERVICE
- 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;
#endif
if (ok != 0)
return ok;
ok = 1;
#if START_SERVICE
/* restart to check persistence! */
- pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-statistics",
+ proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-statistics",
"gnunet-service-statistics",
#if DEBUG_STATISTICS
"-L", "DEBUG",
@@ -190,12 +192,14 @@ check ()
GNUNET_PROGRAM_run (5, argv, "test-statistics-api", "nohelp",
options, &run_more, &ok);
#if START_SERVICE
- 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;
#endif
return ok;
}
diff --git a/src/statistics/test_statistics_api_loop.c b/src/statistics/test_statistics_api_loop.c
index 289e8f09f9..b4e7ae7ab2 100644
--- a/src/statistics/test_statistics_api_loop.c
+++ b/src/statistics/test_statistics_api_loop.c
@@ -96,8 +96,8 @@ check ()
GNUNET_GETOPT_OPTION_END
};
#if START_SERVICE
- pid_t pid;
- pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-statistics",
+ GNUNET_OS_Process *proc;
+ proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-statistics",
"gnunet-service-statistics",
#if DEBUG_STATISTICS
"-L", "DEBUG",
@@ -107,12 +107,14 @@ check ()
GNUNET_PROGRAM_run (3, argv, "test-statistics-api", "nohelp",
options, &run, &ok);
#if START_SERVICE
- 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;
#endif
return ok;
}