-only trigger check config if we actually need it
[oweals/gnunet.git] / src / statistics / gnunet-service-statistics.c
index 840323b95d1042dc2a623da5bb36294673997ef1..8d989dafbeed061a25b51fffee74562499ffd521 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2009, 2010, 2012, 2014 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009, 2010, 2012, 2014 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 
 /**
@@ -321,7 +321,7 @@ load (struct GNUNET_SERVER_Handle *server)
   }
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               _("Loading %llu bytes of statistics from `%s'\n"),
-              fsize, fn);
+              (unsigned long long) fsize, fn);
   mst = GNUNET_SERVER_mst_create (&inject_message,
                                   server);
   GNUNET_break (GNUNET_OK ==
@@ -475,7 +475,7 @@ transmit (struct GNUNET_SERVER_Client *client,
               e->subsystem->service,
               e->name,
               e->persistent,
-              e->value);
+              (unsigned long long) e->value);
   GNUNET_SERVER_notification_context_unicast (nc, client, &m->header,
                                               GNUNET_NO);
   GNUNET_free (m);
@@ -793,7 +793,7 @@ handle_set (void *cls,
                 "Statistic `%s:%s' updated to value %llu (%d).\n",
                 service,
                 name,
-                pos->value,
+                (unsigned long long) pos->value,
                 pos->persistent);
     if ( (changed) ||
          (1 == initial_set) )
@@ -829,7 +829,7 @@ handle_set (void *cls,
               "New statistic on `%s:%s' with value %llu created.\n",
               service,
               name,
-              pos->value);
+              (unsigned long long) pos->value);
   GNUNET_SERVER_receive_done (client,
                               GNUNET_OK);
 }
@@ -907,7 +907,7 @@ handle_watch (void *cls,
                 "New statistic on `%s:%s' with value %llu created.\n",
                 service,
                 name,
-                pos->value);
+                (unsigned long long) pos->value);
   }
   we = GNUNET_new (struct WatchEntry);
   we->client = client;
@@ -967,11 +967,9 @@ do_shutdown ()
  * 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)
 {
   in_shutdown = GNUNET_YES;
   if (0 != client_count)
@@ -1055,9 +1053,8 @@ run (void *cls,
                                    &handle_client_disconnect,
                                    NULL);
   load (server);
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
-                                &shutdown_task,
-                                NULL);
+  GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+                                NULL);
 }