diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-04-28 08:39:27 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-04-28 08:39:27 +0000 |
commit | f93fea70b8018262f5142f2ed57ab90356acd372 (patch) | |
tree | 53554d8dad991efe7b655638454707aa1e14370c /src/statistics/test_statistics_api_watch.c | |
parent | 66683153d35bf38d449a3bbfd071884cf1e0b156 (diff) | |
download | gnunet-f93fea70b8018262f5142f2ed57ab90356acd372.tar.gz gnunet-f93fea70b8018262f5142f2ed57ab90356acd372.zip |
fixing 1671
Diffstat (limited to 'src/statistics/test_statistics_api_watch.c')
-rw-r--r-- | src/statistics/test_statistics_api_watch.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/statistics/test_statistics_api_watch.c b/src/statistics/test_statistics_api_watch.c index 0e5b7ae86..a7ae490a7 100644 --- a/src/statistics/test_statistics_api_watch.c +++ b/src/statistics/test_statistics_api_watch.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include "gnunet_scheduler_lib.h" | 29 | #include "gnunet_scheduler_lib.h" |
30 | #include "gnunet_statistics_service.h" | 30 | #include "gnunet_statistics_service.h" |
31 | 31 | ||
32 | #define VERBOSE GNUNET_YES | 32 | #define VERBOSE GNUNET_NO |
33 | 33 | ||
34 | #define START_SERVICE GNUNET_YES | 34 | #define START_SERVICE GNUNET_YES |
35 | 35 | ||
@@ -53,6 +53,14 @@ force_shutdown (void *cls, | |||
53 | ok = 7; | 53 | ok = 7; |
54 | } | 54 | } |
55 | 55 | ||
56 | static void | ||
57 | normal_shutdown (void *cls, | ||
58 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
59 | { | ||
60 | GNUNET_STATISTICS_destroy (h, GNUNET_NO); | ||
61 | GNUNET_STATISTICS_destroy (h2, GNUNET_NO); | ||
62 | } | ||
63 | |||
56 | static int | 64 | static int |
57 | watch_1 (void *cls, | 65 | watch_1 (void *cls, |
58 | const char *subsystem, | 66 | const char *subsystem, |
@@ -66,9 +74,8 @@ watch_1 (void *cls, | |||
66 | ok &= ~1; | 74 | ok &= ~1; |
67 | if (0 == ok) | 75 | if (0 == ok) |
68 | { | 76 | { |
69 | GNUNET_STATISTICS_destroy (h, GNUNET_NO); | ||
70 | GNUNET_STATISTICS_destroy (h2, GNUNET_NO); | ||
71 | GNUNET_SCHEDULER_cancel (shutdown_task); | 77 | GNUNET_SCHEDULER_cancel (shutdown_task); |
78 | GNUNET_SCHEDULER_add_now (&normal_shutdown, NULL); | ||
72 | } | 79 | } |
73 | return GNUNET_OK; | 80 | return GNUNET_OK; |
74 | } | 81 | } |
@@ -86,9 +93,8 @@ watch_2 (void *cls, | |||
86 | ok &= ~2; | 93 | ok &= ~2; |
87 | if (0 == ok) | 94 | if (0 == ok) |
88 | { | 95 | { |
89 | GNUNET_STATISTICS_destroy (h, GNUNET_NO); | ||
90 | GNUNET_STATISTICS_destroy (h2, GNUNET_NO); | ||
91 | GNUNET_SCHEDULER_cancel (shutdown_task); | 96 | GNUNET_SCHEDULER_cancel (shutdown_task); |
97 | GNUNET_SCHEDULER_add_now (&normal_shutdown, NULL); | ||
92 | } | 98 | } |
93 | return GNUNET_OK; | 99 | return GNUNET_OK; |
94 | } | 100 | } |