From 871f300a2c5832ca8df66e956fccf2bdfb9a95c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dejean?= Date: Sun, 26 Aug 2007 16:05:36 +0000 Subject: Added a bufsiz argument to file_to_buffer(). Increased read buffer size in get_sysinfo(). svn path=/trunk/; revision=2637 --- sysdeps/linux/sysinfo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sysdeps/linux/sysinfo.c') diff --git a/sysdeps/linux/sysinfo.c b/sysdeps/linux/sysinfo.c index 3e4f9695..9b3747de 100644 --- a/sysdeps/linux/sysinfo.c +++ b/sysdeps/linux/sysinfo.c @@ -26,7 +26,7 @@ #include "glibtop_private.h" -#define FILENAME "/proc/cpuinfo" +#define FILENAME "/home/benoit/Desktop/libgtop/cpuinfo8.txt" static const unsigned long _glibtop_sysdeps_sysinfo = (1L << GLIBTOP_SYSINFO_CPUINFO); @@ -36,12 +36,12 @@ static glibtop_sysinfo sysinfo = { .flags = 0 }; static void init_sysinfo (glibtop *server) { - char buffer [BUFSIZ]; + char buffer [16384]; gchar ** processors; if(G_LIKELY(sysinfo.flags)) return; - file_to_buffer(server, buffer, FILENAME); + file_to_buffer(server, buffer, sizeof buffer, FILENAME); /* cpuinfo records are seperated by a blank line */ processors = g_strsplit(buffer, "\n\n", 0); -- cgit v1.2.1