summaryrefslogtreecommitdiffstats
path: root/collectors/proc.plugin/proc_net_sockstat.c
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/proc.plugin/proc_net_sockstat.c')
-rw-r--r--collectors/proc.plugin/proc_net_sockstat.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/collectors/proc.plugin/proc_net_sockstat.c b/collectors/proc.plugin/proc_net_sockstat.c
index 994cbad7b6..db75bee1ab 100644
--- a/collectors/proc.plugin/proc_net_sockstat.c
+++ b/collectors/proc.plugin/proc_net_sockstat.c
@@ -27,14 +27,14 @@ static struct proc_net_sockstat {
static int read_tcp_mem(void) {
static char *filename = NULL;
- static RRDVAR *tcp_mem_low_threshold = NULL,
+ static const RRDVAR_ACQUIRED *tcp_mem_low_threshold = NULL,
*tcp_mem_pressure_threshold = NULL,
*tcp_mem_high_threshold = NULL;
if(unlikely(!tcp_mem_low_threshold)) {
- tcp_mem_low_threshold = rrdvar_custom_host_variable_create(localhost, "tcp_mem_low");
- tcp_mem_pressure_threshold = rrdvar_custom_host_variable_create(localhost, "tcp_mem_pressure");
- tcp_mem_high_threshold = rrdvar_custom_host_variable_create(localhost, "tcp_mem_high");
+ tcp_mem_low_threshold = rrdvar_custom_host_variable_add_and_acquire(localhost, "tcp_mem_low");
+ tcp_mem_pressure_threshold = rrdvar_custom_host_variable_add_and_acquire(localhost, "tcp_mem_pressure");
+ tcp_mem_high_threshold = rrdvar_custom_host_variable_add_and_acquire(localhost, "tcp_mem_high");
}
if(unlikely(!filename)) {
@@ -69,7 +69,7 @@ static int read_tcp_mem(void) {
static kernel_uint_t read_tcp_max_orphans(void) {
static char *filename = NULL;
- static RRDVAR *tcp_max_orphans_var = NULL;
+ static const RRDVAR_ACQUIRED *tcp_max_orphans_var = NULL;
if(unlikely(!filename)) {
char buffer[FILENAME_MAX + 1];
@@ -81,7 +81,7 @@ static kernel_uint_t read_tcp_max_orphans(void) {
if(read_single_number_file(filename, &tcp_max_orphans) == 0) {
if(unlikely(!tcp_max_orphans_var))
- tcp_max_orphans_var = rrdvar_custom_host_variable_create(localhost, "tcp_max_orphans");
+ tcp_max_orphans_var = rrdvar_custom_host_variable_add_and_acquire(localhost, "tcp_max_orphans");
rrdvar_custom_host_variable_set(localhost, tcp_max_orphans_var, tcp_max_orphans);
return tcp_max_orphans;