summaryrefslogtreecommitdiffstats
path: root/claim
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2023-07-12 21:28:46 +0300
committerGitHub <noreply@github.com>2023-07-12 21:28:46 +0300
commit15e15d0f24fd0f6122a367db9efd93c2aa8c1146 (patch)
treead54b39f24f1bd7a9231dc2550f6cfde578f7af4 /claim
parent304ab4fc66572efc9b461316b2962007f30ec111 (diff)
Fix coverity issues (#15375)
* parser cannot be null -- CID 394449 Dereference before null check (REVERSE_INULL) * Fix warning - ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
Diffstat (limited to 'claim')
-rw-r--r--claim/claim.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/claim/claim.c b/claim/claim.c
index 825f27bd5b..a30fd0dab1 100644
--- a/claim/claim.c
+++ b/claim/claim.c
@@ -257,8 +257,10 @@ bool netdata_random_session_id_generate(void) {
if (write(fd, guid, UUID_STR_LEN - 1) != UUID_STR_LEN - 1) {
netdata_log_error("Cannot write the random session id file '%s'.", filename);
ret = false;
- } else
- (void) write(fd, "\n", 1);
+ } else {
+ ssize_t bytes = write(fd, "\n", 1);
+ UNUSED(bytes);
+ }
close(fd);
}