-check return value
[oweals/gnunet.git] / src / util / program.c
index bfa58dc65c3eeebfbb91d7601b7aa327e537f493..9e1a83d0bcc071252214e5eac03b973f2d98d5ec 100644 (file)
@@ -72,6 +72,11 @@ struct CommandContext
 
 };
 
+int
+GNUNET_SPEEDUP_start_ (const struct GNUNET_CONFIGURATION_Handle *cfg);
+
+int
+GNUNET_SPEEDUP_stop_ (void);
 
 /**
  * Initial task called by the scheduler for each
@@ -81,6 +86,7 @@ static void
 program_main (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct CommandContext *cc = cls;
+  GNUNET_SPEEDUP_start_(cc->cfg);
 
   GNUNET_RESOLVER_connect (cc->cfg);
   cc->task (cc->task_cls, cc->args, cc->cfgfile, cc->cfg);
@@ -95,10 +101,10 @@ program_main (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  * @param a2 second command line option
  */
 static int
-cmd_sorter (__const void *a1, __const void *a2)
+cmd_sorter (const void *a1, const void *a2)
 {
-  __const struct GNUNET_GETOPT_CommandLineOption *c1 = a1;
-  __const struct GNUNET_GETOPT_CommandLineOption *c2 = a2;
+  const struct GNUNET_GETOPT_CommandLineOption *c1 = a1;
+  const struct GNUNET_GETOPT_CommandLineOption *c2 = a2;
 
   if (toupper ((unsigned char) c1->shortName) >
       toupper ((unsigned char) c2->shortName))
@@ -260,6 +266,7 @@ GNUNET_PROGRAM_run2 (int argc, char *const *argv, const char *binaryName,
           cc.task (cc.task_cls, cc.args, cc.cfgfile, cc.cfg);
   }
   /* clean up */
+  GNUNET_SPEEDUP_stop_ ();
   GNUNET_CONFIGURATION_destroy (cfg);
   GNUNET_free_non_null (cc.cfgfile);
   GNUNET_free_non_null (loglev);