[rrd-developers] [PATCH] rrdc_flush_if_daemon should not clobber error message

Sebastian Harl sh at tokkee.org
Thu Oct 16 08:43:59 CEST 2008


Hi,

On Thu, Oct 16, 2008 at 06:30:47AM +0000, kevin brintnall wrote:
> --- a/src/rrd_client.c
> +++ b/src/rrd_client.c
> @@ -615,14 +615,7 @@ int rrdc_flush_if_daemon (const char *opt_daemon, const char *filename) /* {{{ *
>    rrdc_connect(opt_daemon);
>  
>    if (rrdc_is_connected(opt_daemon))
> -  {
>      status = rrdc_flush (filename);
> -    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 */

How about something like this (just to make sure there is a fallback):

  rrd_clear_error();
  status = rrdc_flush(filename);
  if ((status != 0) && (! rrd_test_error()))
      rrd_set_error(...);

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.oetiker.ch/pipermail/rrd-developers/attachments/20081016/966b93d7/attachment-0001.bin 


More information about the rrd-developers mailing list