[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r21303 - gnunet/src/statistics
From: |
gnunet |
Subject: |
[GNUnet-SVN] r21303 - gnunet/src/statistics |
Date: |
Sun, 6 May 2012 20:24:05 +0200 |
Author: grothoff
Date: 2012-05-06 20:24:05 +0200 (Sun, 06 May 2012)
New Revision: 21303
Modified:
gnunet/src/statistics/gnunet-statistics.c
gnunet/src/statistics/statistics_api.c
Log:
-cleaner
Modified: gnunet/src/statistics/gnunet-statistics.c
===================================================================
--- gnunet/src/statistics/gnunet-statistics.c 2012-05-06 18:18:50 UTC (rev
21302)
+++ gnunet/src/statistics/gnunet-statistics.c 2012-05-06 18:24:05 UTC (rev
21303)
@@ -62,6 +62,7 @@
*/
static int quiet;
+
/**
* Callback function to process statistic values.
*
@@ -103,18 +104,28 @@
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.
*
@@ -140,17 +151,18 @@
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;
Modified: gnunet/src/statistics/statistics_api.c
===================================================================
--- gnunet/src/statistics/statistics_api.c 2012-05-06 18:18:50 UTC (rev
21302)
+++ gnunet/src/statistics/statistics_api.c 2012-05-06 18:24:05 UTC (rev
21303)
@@ -412,7 +412,6 @@
}
-
/**
* Task used by 'reconnect_later' to shutdown the handle
*
@@ -428,6 +427,7 @@
GNUNET_STATISTICS_destroy (h, GNUNET_NO);
}
+
/**
* Reconnect at a later time, respecting back-off.
*
@@ -911,7 +911,7 @@
}
if (sync_first)
{
- if (h->current != NULL)
+ if (NULL != h->current)
{
if (h->current->type == ACTION_GET)
{
@@ -947,9 +947,9 @@
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))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r21303 - gnunet/src/statistics,
gnunet <=