summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 136326a)
raw | patch | inline | side by side (parent: 136326a)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 7 Jun 2008 18:39:04 +0000 (20:39 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 7 Jun 2008 18:39:04 +0000 (20:39 +0200) |
Under Solaris the init functions are called every time the kstat chain
is updated. Since, among other things, send_buffer_fill was set to zero
here, the plugin ``forgot'' about values.
Thank you very much to Eric LeBlanc for debugging this issue.
is updated. Since, among other things, send_buffer_fill was set to zero
here, the plugin ``forgot'' about values.
Thank you very much to Eric LeBlanc for debugging this issue.
src/network.c | patch | blob | history |
diff --git a/src/network.c b/src/network.c
index b67928c7c2fe6a10aec868ba61c5c7fbe512f6c9..ff806af3a10ac72eaa53a6a4edbd33a0f36b0f6e 100644 (file)
--- a/src/network.c
+++ b/src/network.c
static c_avl_tree_t *cache_tree = NULL;
static pthread_mutex_t cache_lock = PTHREAD_MUTEX_INITIALIZER;
-static time_t cache_flush_last;
+static time_t cache_flush_last = 0;
static int cache_flush_interval = 1800;
/*
plugin_unregister_write ("network");
plugin_unregister_shutdown ("network");
+ /* Let the init function do it's move again ;) */
+ cache_flush_last = 0;
+
return (0);
} /* int network_shutdown */
static int network_init (void)
{
+ /* Check if we were already initialized. If so, just return - there's
+ * nothing more to do (for now, that is). */
+ if (cache_flush_last != 0)
+ return (0);
+
plugin_register_shutdown ("network", network_shutdown);
send_buffer_ptr = send_buffer;