summaryrefslogtreecommitdiffstats
path: root/libnetdata/procfile/procfile.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:19:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:19:22 +0000
commitc21c3b0befeb46a51b6bf3758ffa30813bea0ff0 (patch)
tree9754ff1ca740f6346cf8483ec915d4054bc5da2d /libnetdata/procfile/procfile.c
parentAdding upstream version 1.43.2. (diff)
downloadnetdata-c21c3b0befeb46a51b6bf3758ffa30813bea0ff0.tar.xz
netdata-c21c3b0befeb46a51b6bf3758ffa30813bea0ff0.zip
Adding upstream version 1.44.3.upstream/1.44.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libnetdata/procfile/procfile.c')
-rw-r--r--libnetdata/procfile/procfile.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libnetdata/procfile/procfile.c b/libnetdata/procfile/procfile.c
index 1a7e47a56..0bc731d68 100644
--- a/libnetdata/procfile/procfile.c
+++ b/libnetdata/procfile/procfile.c
@@ -407,9 +407,14 @@ procfile *procfile_open(const char *filename, const char *separators, uint32_t f
int fd = open(filename, procfile_open_flags, 0666);
if(unlikely(fd == -1)) {
- if(unlikely(!(flags & PROCFILE_FLAG_NO_ERROR_ON_FILE_IO))) collector_error(PF_PREFIX ": Cannot open file '%s'", filename);
- else if(unlikely(flags & PROCFILE_FLAG_ERROR_ON_ERROR_LOG))
+ if (unlikely(flags & PROCFILE_FLAG_ERROR_ON_ERROR_LOG))
netdata_log_error(PF_PREFIX ": Cannot open file '%s'", filename);
+ else if (unlikely(!(flags & PROCFILE_FLAG_NO_ERROR_ON_FILE_IO))) {
+ if (errno == ENOENT)
+ collector_info(PF_PREFIX ": Cannot open file '%s'", filename);
+ else
+ collector_error(PF_PREFIX ": Cannot open file '%s'", filename);
+ }
return NULL;
}