]> git.ipfire.org Git - collecty.git/commitdiff
module: Explicitely clear any RRD errors
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Sep 2025 12:01:26 +0000 (12:01 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Sep 2025 12:01:26 +0000 (12:01 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/module.c

index 103c105241db6367eba87711e8f844fa50e8ff0f..a94f4d72b552acb771e30deaeaec020c677473da 100644 (file)
@@ -351,6 +351,7 @@ static int collecty_module_create_database(collecty_module* self, const char* pa
        r = rrd_create_r(path, STEPSIZE, 0, collecty_args_argc(args), collecty_args_argv(args));
        if (r < 0) {
                ERROR(self->ctx, "Failed to create %s: %s\n", path, rrd_get_error());
+               rrd_clear_error();
                r = -EINVAL;
        }
 
@@ -394,6 +395,7 @@ int collecty_module_commit(collecty_module* self,
        r = rrd_update_r(path, NULL, num_samples, samples);
        if (r < 0) {
                ERROR(self->ctx, "Failed to write to %s: %s\n", path, rrd_get_error());
+               rrd_clear_error();
                return -EFAULT;
        }