X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fpeerstore%2Fgnunet-peerstore.c;h=2f849c1500e1e57f0d6db6282b840a271567c7b9;hb=d19cf93d1d02b81de46d7d90920978de6e4edab2;hp=f99c428190a4654f2277d6b6f72b61a41eb3fc6f;hpb=e5d7c67c647e9620c5c1ae77e133a74698443ee1;p=oweals%2Fgnunet.git diff --git a/src/peerstore/gnunet-peerstore.c b/src/peerstore/gnunet-peerstore.c index f99c42819..2f849c150 100644 --- a/src/peerstore/gnunet-peerstore.c +++ b/src/peerstore/gnunet-peerstore.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - (C) + Copyright (C) GNUnet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -41,16 +41,16 @@ struct GNUNET_PEERSTORE_Handle *peerstore_handle; * @param tc scheduler context */ static void -shutdown_task (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc) +shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - if(NULL != peerstore_handle) + if (NULL != peerstore_handle) { - GNUNET_PEERSTORE_disconnect(peerstore_handle, GNUNET_YES); + GNUNET_PEERSTORE_disconnect (peerstore_handle, GNUNET_YES); peerstore_handle = NULL; } } + /** * Main function that will be run by the scheduler. * @@ -60,22 +60,20 @@ shutdown_task (void *cls, * @param cfg configuration */ static void -run (void *cls, - char *const *args, - const char *cfgfile, +run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { peerstore_handle = NULL; - GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, - &shutdown_task, - NULL); - peerstore_handle = GNUNET_PEERSTORE_connect(cfg); - GNUNET_assert(NULL != peerstore_handle); + GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, + NULL); + peerstore_handle = GNUNET_PEERSTORE_connect (cfg); + GNUNET_assert (NULL != peerstore_handle); ret = 0; } + /** * The main function to peerstore. * @@ -90,12 +88,9 @@ main (int argc, char *const *argv) GNUNET_GETOPT_OPTION_END }; return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, - argv, - "gnunet-peerstore [options [value]]", - gettext_noop - ("peerstore"), - options, &run, NULL)) ? ret : 1; + GNUNET_PROGRAM_run (argc, argv, "gnunet-peerstore [options [value]]", + gettext_noop ("peerstore"), options, &run, + NULL)) ? ret : 1; } /* end of gnunet-peerstore.c */