diff options
author | Nathan Scott <nathans@redhat.com> | 2023-09-01 09:49:11 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2023-09-04 08:59:51 +1000 |
commit | eb86bdf3771493ee7567f7ab336cc8735f618bae (patch) | |
tree | 178f8d87528999930602f30b15454c952045c1d9 /pcp | |
parent | 5d47e2c50d77e46666f37a3cdb19f27ba3432a9f (diff) |
Cast some ignored return codes to assist static checkers
Coverity scanning rightly warns that a usually-checked return
status was being ignored in two locations. These two are in
cases where it's safe to ignore, so I've adjusted the code to
maintain coverage even though they are false positives here.
Diffstat (limited to 'pcp')
-rw-r--r-- | pcp/Instance.c | 3 | ||||
-rw-r--r-- | pcp/Metric.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/pcp/Instance.c b/pcp/Instance.c index 1515dfe6..f915350d 100644 --- a/pcp/Instance.c +++ b/pcp/Instance.c @@ -81,7 +81,8 @@ static const char* Instance_externalName(Row* super) { Instance* this = (Instance*) super; if (!this->name) - pmNameInDom(InDom_getId(this), Instance_getId(this), &this->name); + /* ignore any failure here - its safe and we try again next time */ + (void)pmNameInDom(InDom_getId(this), Instance_getId(this), &this->name); return this->name; } diff --git a/pcp/Metric.c b/pcp/Metric.c index ce6d90d0..4a3c858d 100644 --- a/pcp/Metric.c +++ b/pcp/Metric.c @@ -182,7 +182,8 @@ bool Metric_fetch(struct timeval* timestamp) { void Metric_externalName(Metric metric, int inst, char** externalName) { const pmDesc* desc = &pcp->descs[metric]; - pmNameInDom(desc->indom, inst, externalName); + /* ignore a failure here - its safe to do so */ + (void)pmNameInDom(desc->indom, inst, externalName); } int Metric_lookupText(const char* metric, char** desc) { |