On Sat, 09.03.13 22:48, Kok, Auke-jan H ([email protected]) wrote:

> 
> On Sat, Mar 9, 2013 at 4:56 PM, Pierre Schmitz <[email protected]> wrote:
> > Am 09.03.2013 23:41, schrieb Kok, Auke-jan H:
> >> The problem is that the code is now generating coordinates as follows:
> >>
> >>     <rect class="box" x="0" y="0" width="2204,000" height="3440,000" />
> >>
> >> Obviously, that needs to be a "." and not a ",".
> >>
> >> Do you get proper output if you run `LC_NUMERIC=C systemd-analyze plot` 
> >> ... ?
> >
> > Good catch, this will produce the following output which renders just
> > fine: http://paste.xinu.at/3IYLR/
> 
> And, it's already fixed in git. Lennart did some cleanups in between
> breakfast and coffee after v198 and committed a cleanup to
> systemd-analyze which includes:
> 
> @@ -776,18 +820,19 @@ int main(int argc, char *argv[]) {
>          DBusConnection *bus = NULL;
> 
>          setlocale(LC_ALL, "");
> +        setlocale(LC_NUMERIC, "C"); /* we want to format/parse floats
> in C style */

Yes, I "fixed" this issue this way the other day. In general I must say
that formatting floats with printf() or parsing them is something we
really shouldn't do. That's inherently locale-based and hence really
broken. Unfortunately libc doesn't really offer any locale-independent
versions, which is quite a limitation.

Setting LC_NUMERIC is a hack that works for trivial cases, but sucks in
many way, as it is a global setting, which should be local. A program
that outputs floats to the user and into generated files as well
interleaved, would have to constantly switch back and forth which is not
only slow but also a nightmare in threaded environments.

I figure bootchart needs to be fixed the same way...

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to