Added a bufsiz argument to file_to_buffer().

Increased read buffer size in get_sysinfo().

svn path=/trunk/; revision=2637
This commit is contained in:
Benoît Dejean
2007-08-26 16:05:36 +00:00
parent 650c8f2582
commit 871f300a2c
18 changed files with 42 additions and 38 deletions

View File

@@ -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);