GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
+ by the Free Software Foundation; either version 3, or (at your
option) any later version.
GNUnet is distributed in the hope that it will be useful, but
static void
run (void *cls,
- struct GNUNET_SCHEDULER_Handle *sched,
char *const *args,
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
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);
i = 0;
GNUNET_break (NULL !=
GNUNET_STATISTICS_get (h, NULL, "test-0",
- GNUNET_TIME_UNIT_SECONDS, &next, &check_1, cls));
+ GNUNET_TIME_UNIT_MINUTES, &next, &check_1, cls));
}
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;
}