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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user