diff options
author | thiagoftsm <thiagoftsm@gmail.com> | 2020-05-26 12:50:04 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-26 12:50:04 +0000 |
commit | 605705a164e2ef562b7b309cf5607918978bc039 (patch) | |
tree | 87293864686799504e70412f88da49f2f7545754 /exporting | |
parent | ba47e197056601c7db3ce8db0db277d155e8118a (diff) |
Missing checks exporting (#9034)
Add tests to uv_mutex_init and uv_cond_init inside exporting.
Diffstat (limited to 'exporting')
-rw-r--r-- | exporting/aws_kinesis/aws_kinesis.c | 6 | ||||
-rw-r--r-- | exporting/graphite/graphite.c | 6 | ||||
-rw-r--r-- | exporting/json/json.c | 6 | ||||
-rw-r--r-- | exporting/opentsdb/opentsdb.c | 12 | ||||
-rw-r--r-- | exporting/prometheus/remote_write/remote_write.c | 6 |
5 files changed, 24 insertions, 12 deletions
diff --git a/exporting/aws_kinesis/aws_kinesis.c b/exporting/aws_kinesis/aws_kinesis.c index cc0da13062..791cad436c 100644 --- a/exporting/aws_kinesis/aws_kinesis.c +++ b/exporting/aws_kinesis/aws_kinesis.c @@ -56,8 +56,10 @@ int init_aws_kinesis_instance(struct instance *instance) error("EXPORTING: cannot create buffer for AWS Kinesis exporting connector instance %s", instance->config.name); return 1; } - uv_mutex_init(&instance->mutex); - uv_cond_init(&instance->cond_var); + if (uv_mutex_init(&instance->mutex)) + return 1; + if (uv_cond_init(&instance->cond_var)) + return 1; if (!instance->engine->aws_sdk_initialized) { aws_sdk_init(); diff --git a/exporting/graphite/graphite.c b/exporting/graphite/graphite.c index 8404722569..f41d1a7b1b 100644 --- a/exporting/graphite/graphite.c +++ b/exporting/graphite/graphite.c @@ -37,8 +37,10 @@ int init_graphite_instance(struct instance *instance) error("EXPORTING: cannot create buffer for graphite exporting connector instance %s", instance->config.name); return 1; } - uv_mutex_init(&instance->mutex); - uv_cond_init(&instance->cond_var); + if (uv_mutex_init(&instance->mutex)) + return 1; + if (uv_cond_init(&instance->cond_var)) + return 1; return 0; } diff --git a/exporting/json/json.c b/exporting/json/json.c index 57bf6a76c6..1770e6222a 100644 --- a/exporting/json/json.c +++ b/exporting/json/json.c @@ -37,8 +37,10 @@ int init_json_instance(struct instance *instance) error("EXPORTING: cannot create buffer for json exporting connector instance %s", instance->config.name); return 1; } - uv_mutex_init(&instance->mutex); - uv_cond_init(&instance->cond_var); + if (uv_mutex_init(&instance->mutex)) + return 1; + if (uv_cond_init(&instance->cond_var)) + return 1; return 0; } diff --git a/exporting/opentsdb/opentsdb.c b/exporting/opentsdb/opentsdb.c index cf55713ed8..41aa43e41b 100644 --- a/exporting/opentsdb/opentsdb.c +++ b/exporting/opentsdb/opentsdb.c @@ -37,8 +37,10 @@ int init_opentsdb_telnet_instance(struct instance *instance) error("EXPORTING: cannot create buffer for opentsdb telnet exporting connector instance %s", instance->config.name); return 1; } - uv_mutex_init(&instance->mutex); - uv_cond_init(&instance->cond_var); + if (uv_mutex_init(&instance->mutex)) + return 1; + if (uv_cond_init(&instance->cond_var)) + return 1; return 0; } @@ -78,8 +80,10 @@ int init_opentsdb_http_instance(struct instance *instance) error("EXPORTING: cannot create buffer for opentsdb HTTP exporting connector instance %s", instance->config.name); return 1; } - uv_mutex_init(&instance->mutex); - uv_cond_init(&instance->cond_var); + if (uv_mutex_init(&instance->mutex)) + return 1; + if (uv_cond_init(&instance->cond_var)) + return 1; return 0; } diff --git a/exporting/prometheus/remote_write/remote_write.c b/exporting/prometheus/remote_write/remote_write.c index 2a94fc44e7..4b6a7ba8ed 100644 --- a/exporting/prometheus/remote_write/remote_write.c +++ b/exporting/prometheus/remote_write/remote_write.c @@ -122,8 +122,10 @@ int init_prometheus_remote_write_instance(struct instance *instance) error("EXPORTING: cannot create buffer for AWS Kinesis exporting connector instance %s", instance->config.name); return 1; } - uv_mutex_init(&instance->mutex); - uv_cond_init(&instance->cond_var); + if (uv_mutex_init(&instance->mutex)) + return 1; + if (uv_cond_init(&instance->cond_var)) + return 1; struct prometheus_remote_write_specific_data *connector_specific_data = callocz(1, sizeof(struct prometheus_remote_write_specific_data)); |