From: Ulrich Drepper Date: Mon, 31 Dec 2001 17:44:02 +0000 (+0000) Subject: (getloadavg): Always use C locale to parse /proc/loadavg. X-Git-Tag: cvs/glibc-2-2-5~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=106be30c1e8591f79e50174501488ea0fce7201b;p=thirdparty%2Fglibc.git (getloadavg): Always use C locale to parse /proc/loadavg. --- diff --git a/sysdeps/unix/sysv/linux/getloadavg.c b/sysdeps/unix/sysv/linux/getloadavg.c index 39b143336a5..e1a372cd5f9 100644 --- a/sysdeps/unix/sysv/linux/getloadavg.c +++ b/sysdeps/unix/sysv/linux/getloadavg.c @@ -18,9 +18,10 @@ 02111-1307 USA. */ #include -#include #include +#include #include +#include /* Put the 1 minute, 5 minute and 15 minute load averages into the first NELEM elements of LOADAVG. @@ -53,8 +54,8 @@ getloadavg (double loadavg[], int nelem) for (i = 0; i < nelem; ++i) { char *endp; - loadavg[i] = strtod (p, &endp); - if (!endp || endp == p) + loadavg[i] = __strtod_l (p, &endp, &_nl_C_locobj); + if (endp == NULL || endp == p) /* This should not happen. The format of /proc/loadavg must have changed. Don't return with what we have, signal an error. */