X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_client.c;h=8e606640455eaa01b47d6f4ff7c7771c2b746a34;hp=5583bfeb59fe5e159b787f2cdb087feb7303a019;hb=d682f1e53fcb7c6e8d9844ff008dc2873a75323d;hpb=837a4b7874724d57e7721e23f65ef57c998d9dff diff --git a/src/rrd_client.c b/src/rrd_client.c index 5583bfe..8e60664 100644 --- a/src/rrd_client.c +++ b/src/rrd_client.c @@ -616,11 +616,21 @@ int rrdc_flush_if_daemon (const char *opt_daemon, const char *filename) /* {{{ * if (rrdc_is_connected(opt_daemon)) { + rrd_clear_error(); status = rrdc_flush (filename); - if (status != 0) + + if (status != 0 && !rrd_test_error()) { - rrd_set_error ("rrdc_flush (%s) failed with status %i.", - filename, status); + 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(..)) */