From c21c3b0befeb46a51b6bf3758ffa30813bea0ff0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 9 Mar 2024 14:19:22 +0100 Subject: Adding upstream version 1.44.3. Signed-off-by: Daniel Baumann --- libnetdata/procfile/procfile.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libnetdata/procfile/procfile.c') 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; } -- cgit v1.2.3