[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r11874 - gnunet/src/statistics
From: |
gnunet |
Subject: |
[GNUnet-SVN] r11874 - gnunet/src/statistics |
Date: |
Tue, 22 Jun 2010 18:28:22 +0200 |
Author: grothoff
Date: 2010-06-22 18:28:22 +0200 (Tue, 22 Jun 2010)
New Revision: 11874
Modified:
gnunet/src/statistics/statistics.h
gnunet/src/statistics/test_statistics_api.c
Log:
make it easy to start service by hand
Modified: gnunet/src/statistics/statistics.h
===================================================================
--- gnunet/src/statistics/statistics.h 2010-06-22 15:16:35 UTC (rev 11873)
+++ gnunet/src/statistics/statistics.h 2010-06-22 16:28:22 UTC (rev 11874)
@@ -27,7 +27,7 @@
#include "gnunet_common.h"
-#define DEBUG_STATISTICS 0
+#define DEBUG_STATISTICS GNUNET_NO
/**
* Statistics message. Contains how long the system is up
Modified: gnunet/src/statistics/test_statistics_api.c
===================================================================
--- gnunet/src/statistics/test_statistics_api.c 2010-06-22 15:16:35 UTC (rev
11873)
+++ gnunet/src/statistics/test_statistics_api.c 2010-06-22 16:28:22 UTC (rev
11874)
@@ -31,6 +31,8 @@
#define VERBOSE GNUNET_NO
+#define START_SERVICE GNUNET_YES
+
static int
check_1 (void *cls,
const char *subsystem,
@@ -95,7 +97,6 @@
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
-
h = GNUNET_STATISTICS_create (sched, "test-statistics-api", cfg);
GNUNET_STATISTICS_set (h, "test-1", 1, GNUNET_NO);
GNUNET_STATISTICS_set (h, "test-2", 2, GNUNET_NO);
@@ -123,7 +124,6 @@
check ()
{
int ok = 1;
- pid_t pid;
char *const argv[] = { "test-statistics-api",
"-c",
"test_statistics_api_data.conf",
@@ -132,23 +132,29 @@
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
+#if START_SERVICE
+ pid_t pid;
pid = 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_PROGRAM_run (3, argv, "test-statistics-api", "nohelp",
options, &run, &ok);
+#if START_SERVICE
if (0 != PLIBC_KILL (pid, SIGTERM))
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
ok = 1;
}
GNUNET_OS_process_wait(pid);
+#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",
"gnunet-service-statistics",
@@ -156,14 +162,17 @@
"-L", "DEBUG",
#endif
"-c", "test_statistics_api_data.conf", NULL);
+#endif
GNUNET_PROGRAM_run (3, argv, "test-statistics-api", "nohelp",
options, &run_more, &ok);
+#if START_SERVICE
if (0 != PLIBC_KILL (pid, SIGTERM))
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
ok = 1;
}
GNUNET_OS_process_wait(pid);
+#endif
return ok;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r11874 - gnunet/src/statistics,
gnunet <=