From: Michael Tremer Date: Sat, 29 Nov 2025 12:36:16 +0000 (+0000) Subject: file: Make the static analyzer happy and check if the file has been opened X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcee6e25e46fa3d15479649e8d4f7dd879e91c78;p=telemetry.git file: Make the static analyzer happy and check if the file has been opened Signed-off-by: Michael Tremer --- diff --git a/src/daemon/file.c b/src/daemon/file.c index 6bb04f3..c4b53f2 100644 --- a/src/daemon/file.c +++ b/src/daemon/file.c @@ -172,6 +172,10 @@ int td_file_walk(td_file* self, size_t l = 0; int r; + // Check if the file has been opened (and make the static analyzer happy) + if (!self->f) + return -ENOTSUP; + // Start at the beginning of the stream r = fseek(self->f, 0L, SEEK_SET); if (r < 0)