aboutsummaryrefslogtreecommitdiff
path: root/src/arm/gnunet-arm.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-03-01 13:59:23 +0000
committerChristian Grothoff <christian@grothoff.org>2012-03-01 13:59:23 +0000
commit370ec6d2cd26fa31f134da67e2a6a9e0d8902d6f (patch)
tree4158092c13add351264bfd3f000d9f91b03c1630 /src/arm/gnunet-arm.c
parentbd048eb574eca410e76d81ee6dd1b214b6966e92 (diff)
downloadgnunet-370ec6d2cd26fa31f134da67e2a6a9e0d8902d6f.tar.gz
gnunet-370ec6d2cd26fa31f134da67e2a6a9e0d8902d6f.zip
-minor fixes to arm service list API (#2141)
Diffstat (limited to 'src/arm/gnunet-arm.c')
-rw-r--r--src/arm/gnunet-arm.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c
index b3ab2dc0e..f236a65de 100644
--- a/src/arm/gnunet-arm.c
+++ b/src/arm/gnunet-arm.c
@@ -213,20 +213,18 @@ confirm_cb (void *cls,
213 * @param list copy of the list of running services 213 * @param list copy of the list of running services
214 */ 214 */
215static void 215static void
216list_cb (void *cls, int result, uint16_t count, const char **list) 216list_cb (void *cls, int result, unsigned int count, const char *const*list)
217{ 217{
218 if (result == GNUNET_YES && list != NULL) 218 unsigned int i;
219
220 if ( (result != GNUNET_YES) || (NULL == list) )
219 { 221 {
220 FPRINTF (stdout, "%s", _("Running services:\n-----------------\n"));
221 int i;
222 for (i=0; i<count; i++)
223 {
224 FPRINTF (stdout, "%s\n", list[i]);
225 }
226 GNUNET_free (list);
227 } else {
228 FPRINTF (stderr, "%s", _("Error communicating with ARM. ARM not running?\n")); 222 FPRINTF (stderr, "%s", _("Error communicating with ARM. ARM not running?\n"));
223 return;
229 } 224 }
225 FPRINTF (stdout, "%s", _("Running services:\n"));
226 for (i=0; i<count; i++)
227 FPRINTF (stdout, "%s\n", list[i]);
230} 228}
231 229
232/** 230/**
@@ -353,7 +351,7 @@ cps_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
353 start = 1; 351 start = 1;
354 restart = 0; 352 restart = 0;
355 h = GNUNET_ARM_connect (cfg, NULL); 353 h = GNUNET_ARM_connect (cfg, NULL);
356 if (h == NULL) 354 if (NULL == h)
357 { 355 {
358 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 356 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
359 _("Fatal error initializing ARM API.\n")); 357 _("Fatal error initializing ARM API.\n"));
@@ -368,7 +366,7 @@ cps_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
368 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 366 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
369 "Going to list all running services controlled by ARM.\n"); 367 "Going to list all running services controlled by ARM.\n");
370 368
371 if (h == NULL) 369 if (NULL == h)
372 { 370 {
373 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 371 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
374 _("Fatal error initializing ARM API.\n")); 372 _("Fatal error initializing ARM API.\n"));