Skip to content

[th/strtoll-workaround]

Thomas Haller requested to merge th/strtoll-workaround into master
all: use wrappers for g_ascii_strtoll(), g_ascii_strtoull(), g_ascii_strtod()

Sometimes these function may set errno to unexpected values like EAGAIN.
This causes confusion. Avoid that by using our own wrappers that retry
in that case. For example, in rhbz#1797915 we have failures like:

    errno = 0;
    v = g_ascii_strtoll ("10", 0, &end);
    if (errno != 0)
        g_assert_not_reached ();

as g_ascii_strtoll() would return 10, but also set errno to EAGAIN.

Work around that by using wrapper functions that retry. This certainly
should be fixed in glib (or glibc), but the issues are sever enough to
warrant a workaround.

https://bugzilla.redhat.com/show_bug.cgi?id=1797915

Merge request reports