[rrd-users] [PATCH] invalid times when calling fetch with ruby bindings
Tobias Oetiker
tobi at oetiker.ch
Thu Nov 8 11:16:57 CET 2007
Mike,
thanks ... I have included the fix in 1.2 and trunk and added the
feature to trunk.
cheers
tobi
Yesterday Mike Perham wrote:
> Index: main.c
> ===================================================================
> --- main.c (revision 8873)
> +++ main.c (working copy)
> @@ -129,11 +130,12 @@
> }
> free(raw_data);
>
> - result = rb_ary_new2(4);
> - rb_ary_store(result, 0, INT2FIX(start));
> - rb_ary_store(result, 1, INT2FIX(end));
> + result = rb_ary_new2(5);
> + rb_ary_store(result, 0, INT2NUM(start));
> + rb_ary_store(result, 1, INT2NUM(end));
> rb_ary_store(result, 2, names);
> rb_ary_store(result, 3, data);
> + rb_ary_store(result, 4, INT2FIX(step));
>
> The solution to the corruption is to use the INT2NUM macro, not
> INT2FIX. The latter can lose data on large integers.
>
> Please note the diff above also adds the step value to the returned
> results. This would be a very useful addition to the API for us.
>
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>
>
--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten
http://it.oetiker.ch tobi at oetiker.ch ++41 62 213 9902
More information about the rrd-users
mailing list