line
[oweals/gnunet.git] / src / statistics / test_statistics_api_loop.c
index 289e8f09f91a9360885b4c671e8edf5f96b3b07c..d969e65ce565b8eeee3e0e59e14114da265c0593 100644 (file)
@@ -60,7 +60,6 @@ next (void *cls, int success)
 
 static void
 run (void *cls,
-     struct GNUNET_SCHEDULER_Handle *sched,
      char *const *args,
      const char *cfgfile,
      const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -68,7 +67,7 @@ run (void *cls,
   int i;
   char name[128];
 
-  h = GNUNET_STATISTICS_create (sched, "test-statistics-api-loop", cfg);
+  h = GNUNET_STATISTICS_create ("test-statistics-api-loop", cfg);
   for (i=0;i<ROUNDS;i++)
     {
       GNUNET_snprintf (name, sizeof (name), "test-%d", i % 256);
@@ -96,23 +95,26 @@ check ()
     GNUNET_GETOPT_OPTION_END
   };
 #if START_SERVICE
-  pid_t pid;
-  pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-statistics",
+  struct GNUNET_OS_Process *proc;
+  proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-statistics",
                                  "gnunet-service-statistics",
 #if DEBUG_STATISTICS
                                  "-L", "DEBUG",
 #endif
                                  "-c", "test_statistics_api_data.conf", NULL);
 #endif
+  GNUNET_assert (NULL != proc);
   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;
 }