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

@@ -58,7 +58,7 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid)
memset (buf, 0, sizeof (glibtop_proc_time));
if (proc_stat_to_buffer (buffer, pid))
if (proc_stat_to_buffer(buffer, sizeof buffer, pid))
return;
p = proc_stat_after_cmd (buffer);
@@ -113,7 +113,7 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid)
return;
/* FIXME: doesn't work with 2.6 */
if (proc_file_to_buffer (buffer, "/proc/%d/cpu", pid))
if (proc_file_to_buffer(buffer, sizeof buffer, "/proc/%d/cpu", pid))
return;
p = skip_multiple_token (p, 3);