Update plibc header
[oweals/gnunet.git] / src / util / program.c
index 01a8b496a13911e85922966b1781e3a3f8373fca..aae58db49cebfbfcf15ecb8c7e50f5025e0dcaaa 100644 (file)
@@ -4,7 +4,7 @@
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
  */
 
 #include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_configuration_lib.h"
-#include "gnunet_crypto_lib.h"
-#include "gnunet_directories.h"
-#include "gnunet_getopt_lib.h"
-#include "gnunet_os_lib.h"
-#include "gnunet_program_lib.h"
+#include "gnunet_util_lib.h"
 #include "gnunet_resolver_service.h"
-#include "gnunet_scheduler_lib.h"
+#include "gnunet_directories.h"
 #include <gcrypt.h>
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
@@ -78,6 +72,7 @@ GNUNET_SPEEDUP_start_ (const struct GNUNET_CONFIGURATION_Handle *cfg);
 int
 GNUNET_SPEEDUP_stop_ (void);
 
+
 /**
  * Initial task called by the scheduler for each
  * program.  Runs the program-specific main task.
@@ -86,8 +81,10 @@ static void
 program_main (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct CommandContext *cc = cls;
-  GNUNET_SPEEDUP_start_(cc->cfg);
 
+  if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
+    return;
+  GNUNET_SPEEDUP_start_(cc->cfg);
   GNUNET_RESOLVER_connect (cc->cfg);
   cc->task (cc->task_cls, cc->args, cc->cfgfile, cc->cfg);
 }
@@ -143,7 +140,9 @@ GNUNET_PROGRAM_run2 (int argc, char *const *argv, const char *binaryName,
                     int run_without_scheduler)
 {
   struct CommandContext cc;
+#if ENABLE_NLS
   char *path;
+#endif
   char *loglev;
   char *logfile;
   int ret;