*/
static int quiet;
+
/**
* Callback function to process statistic values.
*
FPRINTF (stderr, "%s", _("Failed to obtain statistics.\n"));
ret = 1;
}
- if (h != NULL)
+ if (NULL != h)
+ {
GNUNET_STATISTICS_destroy (h, GNUNET_NO);
+ h = NULL;
+ }
}
+
+
static void
shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_STATISTICS_Handle *h = cls;
+
GNUNET_STATISTICS_watch_cancel (h, subsystem, name, &printer, h);
- if (h != NULL)
+ if (NULL != h)
+ {
GNUNET_STATISTICS_destroy (h, GNUNET_NO);
+ h = NULL;
+ }
}
+
/**
* Main function that will be run by the scheduler.
*
return;
}
h = GNUNET_STATISTICS_create (subsystem, cfg);
- if (h == NULL)
+ if (NULL == h)
{
ret = 1;
return;
}
GNUNET_STATISTICS_set (h, name, (uint64_t) val, persistent);
GNUNET_STATISTICS_destroy (h, GNUNET_YES);
+ h = NULL;
return;
}
h = GNUNET_STATISTICS_create ("gnunet-statistics", cfg);
- if (h == NULL)
+ if (NULL == h)
{
ret = 1;
return;
}
-
/**
* Task used by 'reconnect_later' to shutdown the handle
*
GNUNET_STATISTICS_destroy (h, GNUNET_NO);
}
+
/**
* Reconnect at a later time, respecting back-off.
*
}
if (sync_first)
{
- if (h->current != NULL)
+ if (NULL != h->current)
{
if (h->current->type == ACTION_GET)
{
GNUNET_CLIENT_notify_transmit_ready (h->client, h->current->msize,
timeout, GNUNET_YES,
&transmit_action, h);
- GNUNET_assert (NULL != h->th);
+ GNUNET_assert (NULL != h->th);
}
- if (h->th != NULL)
+ if (NULL != h->th)
return; /* do not finish destruction just yet */
}
while (NULL != (pos = h->action_head))