aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric B Munson <emunson@mgebm.net>2011-05-25 11:12:09 -0400
committerEric B Munson <emunson@mgebm.net>2011-05-26 10:58:59 -0400
commit5f9f94d0a99bb13e859e0c28077ecd7d88df7f3f (patch)
tree7bad9d261e7bed4860821fc437c0bfaf8c26fa3d
parentc4e7a9cfb380ea9d4ad1bc296be5d967f75f6170 (diff)
downloadlibhugetlbfs-5f9f94d0a99bb13e859e0c28077ecd7d88df7f3f.tar.gz
Make calls to strcmp in hugetlb_env_setup consistent
String comparison in hugetlb_setup_env is done in an inconsisten way. This is a problem because some of the environment variables are checked ignoring case where others are case sensitive. This patch converts all of the comparisons looking for boolean (yes/no) values to ignore case. Signed-off-by: Eric B Munson <emunson@mgebm.net> Acked-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--hugeutils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hugeutils.c b/hugeutils.c
index 70e3d22..b28bd0a 100644
--- a/hugeutils.c
+++ b/hugeutils.c
@@ -371,12 +371,12 @@ void hugetlbfs_setup_env()
/* Determine if shmget() calls should be overridden */
env = getenv("HUGETLB_SHM");
- if (env && !strcmp(env, "yes"))
+ if (env && !strcasecmp(env, "yes"))
__hugetlb_opts.shm_enabled = true;
/* Determine if all reservations should be avoided */
env = getenv("HUGETLB_NO_RESERVE");
- if (env && !strcmp(env, "yes"))
+ if (env && !strcasecmp(env, "yes"))
__hugetlb_opts.no_reserve = true;
}