summaryrefslogtreecommitdiffstats
path: root/fluent-bit/lib/cmetrics/tests/util.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-24 09:54:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-24 09:54:44 +0000
commit836b47cb7e99a977c5a23b059ca1d0b5065d310e (patch)
tree1604da8f482d02effa033c94a84be42bc0c848c3 /fluent-bit/lib/cmetrics/tests/util.c
parentReleasing debian version 1.44.3-2. (diff)
downloadnetdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.tar.xz
netdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.zip
Merging upstream version 1.46.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fluent-bit/lib/cmetrics/tests/util.c')
-rw-r--r--fluent-bit/lib/cmetrics/tests/util.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/fluent-bit/lib/cmetrics/tests/util.c b/fluent-bit/lib/cmetrics/tests/util.c
deleted file mode 100644
index c8c9815e2..000000000
--- a/fluent-bit/lib/cmetrics/tests/util.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-
-/* CMetrics
- * ========
- * Copyright 2021-2022 The CMetrics Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-
-#include <cmetrics/cmetrics.h>
-
-cfl_sds_t read_file(const char *path)
-{
- long flen;
- FILE *f = NULL;
- cfl_sds_t result = NULL;
-
- f = fopen(path, "rb");
- if (!f) {
- return NULL;
- }
-
- if (fseek(f, 0, SEEK_END) == -1) {
- goto err;
- }
-
- flen = ftell(f);
- if (flen < 0) {
- goto err;
- }
-
- if (fseek(f, 0, SEEK_SET) == -1) {
- goto err;
- }
-
- result = cfl_sds_create_size(flen);
- if (!result) {
- goto err;
- }
-
- if (flen > 0 && fread(result, flen, 1, f) != 1) {
- goto err;
- }
-
- cfl_sds_set_len(result, flen);
- fclose(f);
- return result;
-
-err:
- fclose(f);
- if (result) {
- cfl_sds_destroy(result);
- }
- return NULL;
-}
-