path: root/tests/testutils.c
diff options
authorAdam Litke <agl@us.ibm.com>2008-07-17 19:14:52 +0000
committerNishanth Aravamudan <nacc@us.ibm.com>2008-07-21 18:44:19 -0700
commit170ee4e04f4d121e403d39f4ac5aef7a48189a09 (patch)
treeba9f620c496d376d6b9ad63222e62acb740cf078 /tests/testutils.c
parent2d6f0be428a50737b39f5ccd9124e66a8b7918f9 (diff)
tests: testutils copy of read_meminfo buffer is too small
When the hugeutils.c version of read_meminfo was copied to testutils.c, the wrong constant was used to size the buffer used to read /proc/meminfo. This resulted in a smaller (1024B) size instead of 2048B. Some fields were added to /proc/meminfo in a recent kernel and that bumped meminfo over 1024B. Correct the constant usage to bump the size up to 2048B. Signed-off-by: Adam Litke <agl@us.ibm.com> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Diffstat (limited to 'tests/testutils.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/testutils.c b/tests/testutils.c
index 79fb2c2..9d48482 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -39,6 +39,7 @@
#define HUGETLBFS_MAGIC 0x958458f6
#define BUF_SZ 1024
+#define MEMINFO_SZ 2048
int verbose_test = 1;
char *test_name;
@@ -205,7 +206,7 @@ int test_addr_huge(void *p)
long read_meminfo(const char *tag)
int fd;
- char buf[BUF_SZ];
+ char buf[MEMINFO_SZ];
int len, readerr;
char *p, *q;
long val;