From d682f1e53fcb7c6e8d9844ff008dc2873a75323d Mon Sep 17 00:00:00 2001 From: oetiker Date: Fri, 17 Oct 2008 05:50:22 +0000 Subject: [PATCH] rrdc_flush_if_daemon should not clobber error message -- kevin (as suggested by Sebastian) git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1618 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd_client.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/rrd_client.c b/src/rrd_client.c index 5e22a98..8e60664 100644 --- a/src/rrd_client.c +++ b/src/rrd_client.c @@ -615,8 +615,25 @@ int rrdc_flush_if_daemon (const char *opt_daemon, const char *filename) /* {{{ * rrdc_connect(opt_daemon); if (rrdc_is_connected(opt_daemon)) + { + rrd_clear_error(); status = rrdc_flush (filename); + if (status != 0 && !rrd_test_error()) + { + if (status > 0) + { + rrd_set_error("rrdc_flush (%s) failed: %s", + filename, rrd_strerror(status)); + } + else if (status < 0) + { + rrd_set_error("rrdc_flush (%s) failed with status %i.", + filename, status); + } + } + } /* if (rrdc_is_connected(..)) */ + return status; } /* }}} int rrdc_flush_if_daemon */ -- 2.30.2