From: Martin Mares Date: Sat, 3 Mar 2012 17:35:26 +0000 (+0100) Subject: Clear all librrd errors by calling rrd_clear_error() X-Git-Tag: v1.4~3 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=78a7acc0f53e3eadff75fd4f9452b5a974e40334;p=arexx.git Clear all librrd errors by calling rrd_clear_error() Otherwise, the library can get confused by earlier errors. --- 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 ***/