From 78a7acc0f53e3eadff75fd4f9452b5a974e40334 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 3 Mar 2012 18:35:26 +0100 Subject: [PATCH] Clear all librrd errors by calling rrd_clear_error() Otherwise, the library can get confused by earlier errors. --- arexxd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arexxd.c b/arexxd.c index 8cbd567..0358db1 100644 --- a/arexxd.c +++ b/arexxd.c @@ -141,6 +141,7 @@ static void rrd_point(time_t t, const char *name, double val, char *unit) rrd_create(arg_cnt, arg_ptr); if (rrd_test_error()) { log_error("rrd_create on %s failed: %s", rr_name, rrd_get_error()); + rrd_clear_error(); return; } } @@ -149,8 +150,10 @@ static void rrd_point(time_t t, const char *name, double val, char *unit) arg_push(rr_name); arg_push("%d:%f", t, val); rrd_update(arg_cnt, arg_ptr); - if (rrd_test_error()) + if (rrd_test_error()) { log_error("rrd_update on %s failed: %s", rr_name, rrd_get_error()); + rrd_clear_error(); + } } /*** Transforms ***/ -- 2.39.5