summaryrefslogtreecommitdiff
path: root/sysdeps/linux
diff options
context:
space:
mode:
authorBenoît Dejean <bdejean@src.gnome.org>2005-03-27 14:30:30 +0000
committerBenoît Dejean <bdejean@src.gnome.org>2005-03-27 14:30:30 +0000
commitbbc10e3790f98446bb740180e65a320774f6e7c1 (patch)
tree50b6b414b9341cc5edfa51e969bee2969104e1ab /sysdeps/linux
parentf4f88ff224cfb6230d120aad2b263f70365887f5 (diff)
downloadlibgtop-bbc10e3790f98446bb740180e65a320774f6e7c1.tar.gz
Fixed behaviour when locale is not C s/strtod/g_ascii_strod/. (strtod
* loadavg.c: (glibtop_get_loadavg_s): * uptime.c: (glibtop_get_uptime_s): Fixed behaviour when locale is not C s/strtod/g_ascii_strod/. (strtod behaviour is locale specific, which is bad because linux /proc is always C.
Diffstat (limited to 'sysdeps/linux')
-rw-r--r--sysdeps/linux/ChangeLog7
-rw-r--r--sysdeps/linux/loadavg.c6
-rw-r--r--sysdeps/linux/uptime.c4
3 files changed, 12 insertions, 5 deletions
diff --git a/sysdeps/linux/ChangeLog b/sysdeps/linux/ChangeLog
index a0aad694..db13720a 100644
--- a/sysdeps/linux/ChangeLog
+++ b/sysdeps/linux/ChangeLog
@@ -1,3 +1,10 @@
+2005-03-27 Benoît Dejean <TazForEver@dlfp.org>
+
+ * loadavg.c: (glibtop_get_loadavg_s):
+ * uptime.c: (glibtop_get_uptime_s): Fixed behaviour when locale is not C
+ s/strtod/g_ascii_strod/. (strtod behaviour is locale specific, which is bad
+ because linux /proc is always C.)
+
2005-03-25 Benoît Dejean <TazForEver@dlfp.org>
* netload.c: (get_ipv6): s/strerror/g_strerror/
diff --git a/sysdeps/linux/loadavg.c b/sysdeps/linux/loadavg.c
index 664c1f02..2402bd7e 100644
--- a/sysdeps/linux/loadavg.c
+++ b/sysdeps/linux/loadavg.c
@@ -58,9 +58,9 @@ glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf)
file_to_buffer(server, buffer, FILENAME);
- buf->loadavg [0] = strtod (buffer, &p);
- buf->loadavg [1] = strtod (p, &p);
- buf->loadavg [2] = strtod (p, &p);
+ buf->loadavg [0] = g_ascii_strtod (buffer, &p);
+ buf->loadavg [1] = g_ascii_strtod (p, &p);
+ buf->loadavg [2] = g_ascii_strtod (p, &p);
buf->flags = _glibtop_sysdeps_loadavg;
diff --git a/sysdeps/linux/uptime.c b/sysdeps/linux/uptime.c
index bb0ebc29..577842ed 100644
--- a/sysdeps/linux/uptime.c
+++ b/sysdeps/linux/uptime.c
@@ -55,8 +55,8 @@ glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
file_to_buffer(server, buffer, FILENAME);
- buf->uptime = strtod (buffer, &p);
- buf->idletime = strtod (p, &p);
+ buf->uptime = g_ascii_strtod (buffer, &p);
+ buf->idletime = g_ascii_strtod (p, &p);
buf->boot_time = (guint64) time(NULL) - (guint64) buf->uptime;
buf->flags = _glibtop_sysdeps_uptime;