diff options
author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-05-24 07:34:33 +0000 |
---|---|---|
committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-05-24 07:34:33 +0000 |
commit | 2d76b271c36ca347917c91bc22e812d9c786315d (patch) | |
tree | 507977ceb617bcb577c9054773a391b8d1dd446c /src/libs/zbxsysinfo | |
parent | 1db4a2b12e33f801842bd060ecc7b3b06d664dd1 (diff) | |
download | zabbix-2d76b271c36ca347917c91bc22e812d9c786315d.tar.gz zabbix-2d76b271c36ca347917c91bc22e812d9c786315d.tar.xz zabbix-2d76b271c36ca347917c91bc22e812d9c786315d.zip |
- added delta value calculation for UINT64 (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@4164 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/libs/zbxsysinfo')
-rw-r--r-- | src/libs/zbxsysinfo/sysinfo.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/libs/zbxsysinfo/sysinfo.c b/src/libs/zbxsysinfo/sysinfo.c index 570f6c95..bc1f1a83 100644 --- a/src/libs/zbxsysinfo/sysinfo.c +++ b/src/libs/zbxsysinfo/sysinfo.c @@ -69,7 +69,7 @@ void add_metric(ZBX_METRIC *new) commands[i].test_param=strdup(new->test_param); commands = zbx_realloc(commands,(i+2)*sizeof(ZBX_METRIC)); - commands[i+1].key=NULL; + memset(&commands[i+1], 0, sizeof(ZBX_METRIC)); break; } } @@ -135,7 +135,7 @@ void add_user_parameter(char *key,char *command) } } -void init_metrics() +void init_metrics(void) { register int i; @@ -164,6 +164,23 @@ void init_metrics() #endif /* USE_SIMPLE_METRICS */ } +void free_metrics(void) +{ + int i = 0; + + if( commands ) + { + for(i=0; NULL == commands[i].key; i++) + { + zbx_free(commands[i].key); + zbx_free(commands[i].main_param); + zbx_free(commands[i].test_param); + } + + zbx_free(commands); + } +} + void escape_string(char *from, char *to, int maxlen) { register int i,ptr; |