From: Zbigniew Jędrzejewski-Szmek Date: Tue, 12 May 2026 10:38:22 +0000 (+0200) Subject: report-cgroup: use errno_or_else in one more place X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a117488d35988722384c114e2b1ca842e0d77e4d;p=thirdparty%2Fsystemd.git report-cgroup: use errno_or_else in one more place 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. --- 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;