aboutsummaryrefslogtreecommitdiff
path: root/tests/testutils.c
diff options
context:
space:
mode:
authorAdam Litke <agl@us.ibm.com>2008-09-25 16:34:07 +0000
committerEric B Munson <ebmunson@us.ibm.com>2008-09-25 18:13:53 +0100
commitd30836538198e340e1e15921ded5b58c4cad4c48 (patch)
treeff68f6471550e246a76904af147b7e264234e785 /tests/testutils.c
parent89f50f7863f0223abfa0bd4061ae465ded3c00cd (diff)
downloadlibhugetlbfs-d30836538198e340e1e15921ded5b58c4cad4c48.tar.gz
testutils: Convert the system default page size to bytes
When reading the system default huge page size from /proc/meminfo, I forgot to convert it back to bytes from kB. This caused the check that invokes single huge page size compatibility mode to always return false. Fix it so we are not comparing apples to kilo-apples. Signed-off-by: Adam Litke <agl@us.ibm.com> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
Diffstat (limited to 'tests/testutils.c')
-rw-r--r--tests/testutils.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/testutils.c b/tests/testutils.c
index 172ce61..910d116 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -313,6 +313,7 @@ int select_pool_counter(unsigned int counter, unsigned long pagesize,
* read /proc/meminfo.
*/
default_size = file_read_ulong("/proc/meminfo", "Hugepagesize:");
+ default_size *= 1024; /* Convert from kB to B */
if (default_size < 0) {
ERROR("Cannot determine the default page size\n");
return -1;