fix #4546
[oweals/gnunet.git] / src / datastore / gnunet-datastore.c
index 4388818d78e2ec36a42a70b307482a76a59e454f..ddca4ee06b596c1e19aabd086c16e56fffc1391f 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2010, 2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2010, 2013 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.
 */
 
 /**
@@ -70,8 +70,7 @@ static struct GNUNET_DATASTORE_QueueEntry *qe;
 
 
 static void
-do_shutdown (void *cls,
-            const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_shutdown (void *cls)
 {
   if (NULL != qe)
     GNUNET_DATASTORE_cancel (qe);
@@ -84,7 +83,7 @@ do_shutdown (void *cls,
 /**
  * Perform next GET operation.
  */
-static void 
+static void
 do_get (void);
 
 
@@ -101,7 +100,7 @@ do_get (void);
  *                space for 0-priority content
  * @param msg NULL on success, otherwise an error message
  */
-static void 
+static void
 do_finish (void *cls,
           int32_t success,
           struct GNUNET_TIME_Absolute min_expiration,
@@ -135,7 +134,7 @@ do_finish (void *cls,
  * @param uid unique identifier for the datum;
  *        maybe 0 if no unique identifier is available
  */
-static void 
+static void
 do_put (void *cls,
        const struct GNUNET_HashCode *key,
        size_t size, const void *data,
@@ -156,8 +155,8 @@ do_put (void *cls,
     first_uid = uid;
   qe = GNUNET_DATASTORE_put (db_dst, 0,
                             key, size, data, type,
-                            priority, anonymity, 
-                            0 /* FIXME: replication is lost... */, 
+                            priority, anonymity,
+                            0 /* FIXME: replication is lost... */,
                             expiration,
                             0, 1, GNUNET_TIME_UNIT_FOREVER_REL,
                             &do_finish, NULL);
@@ -167,7 +166,7 @@ do_put (void *cls,
 /**
  * Perform next GET operation.
  */
-static void 
+static void
 do_get ()
 {
   qe = GNUNET_DATASTORE_get_key (db_src,
@@ -185,7 +184,7 @@ do_get ()
  *
  * @param cls closure
  * @param args remaining command-line arguments
- * @param cfgfile name of the configuration file used 
+ * @param cfgfile name of the configuration file used
  * @param cfg configuration -- for destination datastore
  */
 static void
@@ -196,7 +195,7 @@ run (void *cls, char *const *args, const char *cfgfile,
     return; /* nothing to be done */
   if (0 == strcmp (cfgfile, alternative_cfg))
   {
-    fprintf (stderr, 
+    fprintf (stderr,
             _("Cannot use the same configuration for source and destination\n"));
     ret = 1;
     return;
@@ -225,8 +224,7 @@ run (void *cls, char *const *args, const char *cfgfile,
     ret = 1;
     return;
   }
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
-                               &do_shutdown, NULL);
+  GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL);
   do_get ();
 }
 
@@ -253,7 +251,7 @@ main (int argc, char *const *argv)
   if (GNUNET_OK !=
       GNUNET_PROGRAM_run (argc, argv, "gnunet-datastore",
                          gettext_noop ("Manipulate GNUnet datastore"),
-                         options, &run, NULL)) 
+                         options, &run, NULL))
     ret = 1;
   GNUNET_free ((void*) argv);
   return ret;