diff options
Diffstat (limited to 'src/peerstore/gnunet-peerstore.c')
-rw-r--r-- | src/peerstore/gnunet-peerstore.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/peerstore/gnunet-peerstore.c b/src/peerstore/gnunet-peerstore.c index 9d95655b4..891676ebd 100644 --- a/src/peerstore/gnunet-peerstore.c +++ b/src/peerstore/gnunet-peerstore.c | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file peerstore/gnunet-peerstore.c | 22 | * @file peerstore/gnunet-peerstore.c |
@@ -41,13 +41,13 @@ static struct GNUNET_PEERSTORE_Handle *peerstore_handle; | |||
41 | * @param cls unused | 41 | * @param cls unused |
42 | */ | 42 | */ |
43 | static void | 43 | static void |
44 | shutdown_task (void *cls) | 44 | shutdown_task(void *cls) |
45 | { | 45 | { |
46 | if (NULL != peerstore_handle) | 46 | if (NULL != peerstore_handle) |
47 | { | 47 | { |
48 | GNUNET_PEERSTORE_disconnect (peerstore_handle, GNUNET_YES); | 48 | GNUNET_PEERSTORE_disconnect(peerstore_handle, GNUNET_YES); |
49 | peerstore_handle = NULL; | 49 | peerstore_handle = NULL; |
50 | } | 50 | } |
51 | } | 51 | } |
52 | 52 | ||
53 | 53 | ||
@@ -60,15 +60,15 @@ shutdown_task (void *cls) | |||
60 | * @param cfg configuration | 60 | * @param cfg configuration |
61 | */ | 61 | */ |
62 | static void | 62 | static void |
63 | run (void *cls, | 63 | run(void *cls, |
64 | char *const *args, | 64 | char *const *args, |
65 | const char *cfgfile, | 65 | const char *cfgfile, |
66 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 66 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
67 | { | 67 | { |
68 | GNUNET_SCHEDULER_add_shutdown (&shutdown_task, | 68 | GNUNET_SCHEDULER_add_shutdown(&shutdown_task, |
69 | NULL); | 69 | NULL); |
70 | peerstore_handle = GNUNET_PEERSTORE_connect (cfg); | 70 | peerstore_handle = GNUNET_PEERSTORE_connect(cfg); |
71 | GNUNET_assert (NULL != peerstore_handle); | 71 | GNUNET_assert(NULL != peerstore_handle); |
72 | ret = 0; | 72 | ret = 0; |
73 | } | 73 | } |
74 | 74 | ||
@@ -81,15 +81,16 @@ run (void *cls, | |||
81 | * @return 0 ok, 1 on error | 81 | * @return 0 ok, 1 on error |
82 | */ | 82 | */ |
83 | int | 83 | int |
84 | main (int argc, char *const *argv) | 84 | main(int argc, char *const *argv) |
85 | { | 85 | { |
86 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 86 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { |
87 | GNUNET_GETOPT_OPTION_END | 87 | GNUNET_GETOPT_OPTION_END |
88 | }; | 88 | }; |
89 | |||
89 | return (GNUNET_OK == | 90 | return (GNUNET_OK == |
90 | GNUNET_PROGRAM_run (argc, argv, "gnunet-peerstore [options [value]]", | 91 | GNUNET_PROGRAM_run(argc, argv, "gnunet-peerstore [options [value]]", |
91 | gettext_noop ("peerstore"), options, &run, | 92 | gettext_noop("peerstore"), options, &run, |
92 | NULL)) ? ret : 1; | 93 | NULL)) ? ret : 1; |
93 | } | 94 | } |
94 | 95 | ||
95 | /* end of gnunet-peerstore.c */ | 96 | /* end of gnunet-peerstore.c */ |