]> git.ipfire.org Git - telemetry.git/commitdiff
file: Make the static analyzer happy and check if the file has been opened
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 29 Nov 2025 12:36:16 +0000 (12:36 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 29 Nov 2025 12:36:16 +0000 (12:36 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/file.c

index 6bb04f333f54273d1bddffcc796e42c637a2c190..c4b53f2cb53e1e813439b065ca1013205a448b76 100644 (file)
@@ -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)