-fix off-by-1
[oweals/gnunet.git] / src / dht / gnunet-service-dht.c
index 006364664cfa426fee65a600a176cf0715327918..a44be2dfe6bc50580b3e58275606a01544185cef 100644 (file)
@@ -98,10 +98,9 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message)
  * Task run during shutdown.
  *
  * @param cls unused
- * @param tc unused
  */
 static void
-shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
 {
   if (NULL != ghh)
   {
@@ -159,11 +158,11 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
   GDS_CLIENTS_init (server);
   if (GNUNET_OK != GDS_NEIGHBOURS_init ())
   {
-    shutdown_task (NULL, NULL);
+    shutdown_task (NULL);
     return;
   }
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
-                                NULL);
+  GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+                                NULL);
   GDS_transport_handle =
       GNUNET_TRANSPORT_connect (GDS_cfg, NULL, NULL, NULL, NULL, NULL);
   if (GDS_transport_handle == NULL)