From a117488d35988722384c114e2b1ca842e0d77e4d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 12 May 2026 12:38:22 +0200 Subject: [PATCH] report-cgroup: use errno_or_else in one more place MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Old gcc is confused about initialization: In function ‘io_read_send’, inlined from ‘walk_cgroups’ at ../src/report/report-cgroup.c:288:24: ../src/report/report-cgroup.c:167:21: error: ‘values[0]’ may be used uninitialized [-Werror=maybe-uninitialized] 167 | r = metric_build_send_unsigned(mf + i, link, unit, values[i], /* fields= */ NULL); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Maybe this helps. --- src/report/report-cgroup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/report/report-cgroup.c b/src/report/report-cgroup.c index 48fcbb5a647..240f09f9f2a 100644 --- a/src/report/report-cgroup.c +++ b/src/report/report-cgroup.c @@ -5,6 +5,7 @@ #include "alloc-util.h" #include "cgroup-util.h" +#include "errno-util.h" #include "extract-word.h" #include "fd-util.h" #include "fileio.h" @@ -97,7 +98,7 @@ static int io_stat_parse(const char *cgroup_path, uint64_t ret[static 2]) { _cleanup_fclose_ FILE *f = fopen(path, "re"); if (!f) - return -errno; + return errno_or_else(EIO); for (;;) { _cleanup_free_ char *line = NULL; -- 2.47.3