* @param list copy of the list of running services
*/
static void
-list_cb (void *cls, int result, uint16_t count, const char **list)
+list_cb (void *cls, int result, unsigned int count, const char *const*list)
{
- if (result == GNUNET_YES && list != NULL)
+ unsigned int i;
+
+ if ( (result != GNUNET_YES) || (NULL == list) )
{
- FPRINTF (stdout, _("Running services:\n-----------------\n"));
- int i;
- for (i=0; i<count; i++)
- {
- FPRINTF (stdout, "%s\n", list[i]);
- }
- GNUNET_free (list);
- } else {
FPRINTF (stderr, "%s", _("Error communicating with ARM. ARM not running?\n"));
+ return;
}
+ FPRINTF (stdout, "%s", _("Running services:\n"));
+ for (i=0; i<count; i++)
+ FPRINTF (stdout, "%s\n", list[i]);
}
/**
start = 1;
restart = 0;
h = GNUNET_ARM_connect (cfg, NULL);
- if (h == NULL)
+ if (NULL == h)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Fatal error initializing ARM API.\n"));
GNUNET_SCHEDULER_add_now (&cps_loop, NULL);
return;
}
+ break;
case 5:
if (list) {
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Going to list all running services controlled by ARM.\n");
- if (h == NULL)
+ if (NULL == h)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Fatal error initializing ARM API.\n"));