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 <[EMAIL PROTECTED]>
---

 tests/testutils.c |    3 ++-
 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;


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to