summaryrefslogtreecommitdiffstats
path: root/libnetdata/procfile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:19:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:20:02 +0000
commit58daab21cd043e1dc37024a7f99b396788372918 (patch)
tree96771e43bb69f7c1c2b0b4f7374cb74d7866d0cb /libnetdata/procfile
parentReleasing debian version 1.43.2-1. (diff)
downloadnetdata-58daab21cd043e1dc37024a7f99b396788372918.tar.xz
netdata-58daab21cd043e1dc37024a7f99b396788372918.zip
Merging upstream version 1.44.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libnetdata/procfile')
-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 1a7e47a5..0bc731d6 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;
}