[rrd-developers] [PATCH] rrd_flush.c: Provide a more useful error message.
Tobias Oetiker
tobi at oetiker.ch
Sun Mar 8 12:13:07 CET 2009
Hi Sebastian,
thanks ... added
tobi
Yesterday Sebastian Harl wrote:
>
> Signed-off-by: Sebastian Harl <sh at tokkee.org>
> ---
> program/src/rrd_flush.c | 16 +++++++++++++++-
> 1 files changed, 15 insertions(+), 1 deletions(-)
>
> diff --git a/program/src/rrd_flush.c b/program/src/rrd_flush.c
> index 2d8df3a..1f72e80 100644
> --- a/program/src/rrd_flush.c
> +++ b/program/src/rrd_flush.c
> @@ -90,7 +90,21 @@ int rrd_cmd_flush (int argc, char **argv)
> for (int i = optind; i < argc; i++)
> {
> status = rrdc_flush(argv[i]);
> - if (status) break;
> + if (status)
> + {
> + char *error;
> + int remaining;
> +
> + error = strdup(rrd_get_error());
> + remaining = argc - optind - 1;
> +
> + rrd_set_error("Flushing of file \"%s\" failed: %s. Skipping "
> + "remaining %i file%s.", argv[i],
> + ((! error) || (*error == '\0')) ? "unknown error" : error,
> + remaining, (remaining == 1) ? "" : "s");
> + free(error);
> + break;
> + }
> }
>
> return ((status == 0) ? 0 : -1);
>
--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900
More information about the rrd-developers
mailing list