-only trigger check config if we actually need it
[oweals/gnunet.git] / src / fs / gnunet-download.c
index a0ea9698aea37259ac8e2e5bf284f743cf099ce9..6d9adb8abe46db55bb120291db753818d0683da7 100644 (file)
@@ -54,7 +54,7 @@ static int local_only;
 
 
 static void
-cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+cleanup_task (void *cls)
 {
   GNUNET_FS_stop (ctx);
   ctx = NULL;
@@ -62,7 +62,7 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 
 static void
-shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
 {
   if (NULL != dc)
   {
@@ -284,8 +284,8 @@ run (void *cls, char *const *args, const char *cfgfile,
     ctx = NULL;
     return;
   }
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
-                                NULL);
+  GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+                                NULL);
 }
 
 
@@ -308,7 +308,7 @@ main (int argc, char *const *argv)
      0, &GNUNET_GETOPT_set_one, &delete_incomplete},
     {'n', "no-network", NULL,
      gettext_noop ("only search the local peer (no P2P network search)"),
-     0, &GNUNET_GETOPT_set_uint, &local_only},
+     0, &GNUNET_GETOPT_set_one, &local_only},
     {'o', "output", "FILENAME",
      gettext_noop ("write the file to FILENAME"),
      1, &GNUNET_GETOPT_set_string, &filename},