libgtop2/read-cpuinfo-completely.patch
2008-11-10 01:53:20 +00:00

21 lines
651 B
Diff

Index: sysdeps/linux/sysinfo.c
===================================================================
--- sysdeps/linux/sysinfo.c (revision 2781)
+++ sysdeps/linux/sysinfo.c (working copy)
@@ -36,12 +36,12 @@
static void
init_sysinfo (glibtop *server)
{
- char buffer [16384];
+ gchar *buffer;
gchar ** processors;
if(G_LIKELY(sysinfo.flags)) return;
- file_to_buffer(server, buffer, sizeof buffer, FILENAME);
+ if (!g_file_get_contents("/proc/cpuinfo", &buffer, NULL, NULL)) return;
/* cpuinfo records are seperated by a blank line */
processors = g_strsplit(buffer, "\n\n", 0);