aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-06-28 12:22:45 +0000
committerNathan S. Evans <evans@in.tum.de>2010-06-28 12:22:45 +0000
commit8a03ca53dd08d834b4d235dcae865e5c699d50ab (patch)
tree97ef650a06552493a673751ecdd6257857c57828
parent18a7236ceb7e05e04c4a8736511821392516b78b (diff)
downloadgnunet-8a03ca53dd08d834b4d235dcae865e5c699d50ab.tar.gz
gnunet-8a03ca53dd08d834b4d235dcae865e5c699d50ab.zip
shutdown callback
-rw-r--r--src/fs/fs_test_lib.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c
index 0b1ff8955..19651079d 100644
--- a/src/fs/fs_test_lib.c
+++ b/src/fs/fs_test_lib.c
@@ -137,6 +137,27 @@ struct GNUNET_FS_TestDaemon
137 137
138}; 138};
139 139
140/**
141 * Check whether peers successfully shut down.
142 */
143void shutdown_callback (void *cls,
144 const char *emsg)
145{
146 if (emsg != NULL)
147 {
148#if VERBOSE
149 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
150 "Shutdown of peers failed!\n");
151#endif
152 }
153 else
154 {
155#if VERBOSE
156 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
157 "All peers successfully shut down!\n");
158#endif
159 }
160}
140 161
141static void 162static void
142report_uri (void *cls, 163report_uri (void *cls,
@@ -307,7 +328,7 @@ start_timeout (void *cls,
307 struct StartContext *sctx = cls; 328 struct StartContext *sctx = cls;
308 unsigned int i; 329 unsigned int i;
309 330
310 GNUNET_TESTING_daemons_stop (sctx->group, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30)); 331 GNUNET_TESTING_daemons_stop (sctx->group, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30), &shutdown_callback, NULL);
311 for (i=0;i<sctx->total;i++) 332 for (i=0;i<sctx->total;i++)
312 { 333 {
313 if (i < sctx->have) 334 if (i < sctx->have)
@@ -507,7 +528,7 @@ GNUNET_FS_TEST_daemons_stop (struct GNUNET_SCHEDULER_Handle *sched,
507 GNUNET_free (daemons[i]); 528 GNUNET_free (daemons[i]);
508 daemons[i] = NULL; 529 daemons[i] = NULL;
509 } 530 }
510 GNUNET_TESTING_daemons_stop (pg, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30)); 531 GNUNET_TESTING_daemons_stop (pg, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30), &shutdown_callback, NULL);
511} 532}
512 533
513 534