aboutsummaryrefslogtreecommitdiff
path: root/kernel-features.c
diff options
context:
space:
mode:
authorEric B Munson <ebmunson@us.ibm.com>2008-12-10 17:36:59 +0000
committerEric B Munson <ebmunson@us.ibm.com>2009-01-08 12:54:50 +0000
commitbc756fc1aed87e863c84c06f1ff4697cd53292c2 (patch)
tree3de49ed445f70e6542ae7929190d0b19a16dd659 /kernel-features.c
parentddbe305bcc6c0216f8c1e27dc4da29b011384064 (diff)
downloadlibhugetlbfs-bc756fc1aed87e863c84c06f1ff4697cd53292c2.tar.gz
Move all getenv calls from various function in hugeutils into hugetlbfs_setup_env
Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
Diffstat (limited to 'kernel-features.c')
-rw-r--r--kernel-features.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/kernel-features.c b/kernel-features.c
index 79c499c..4bb0149 100644
--- a/kernel-features.c
+++ b/kernel-features.c
@@ -214,7 +214,6 @@ static int check_features_env_valid(const char *env)
void setup_features()
{
struct utsname u;
- char *env;
int i;
if (uname(&u)) {
@@ -226,10 +225,10 @@ void setup_features()
debug_kernel_version();
/* Check if the user has overrided any features */
- env = getenv("HUGETLB_FEATURES");
- if (env && check_features_env_valid(env) == -1) {
+ if (__hugetlb_opts.features &&
+ check_features_env_valid(__hugetlb_opts.features) == -1) {
ERROR("HUGETLB_FEATURES was invalid -- ignoring.\n");
- env = NULL;
+ __hugetlb_opts.features = NULL;
}
for (i = 0; i < HUGETLB_FEATURE_NR; i++) {
@@ -240,10 +239,12 @@ void setup_features()
str_to_ver(kernel_features[i].required_version, &ver);
/* Has the user overridden feature detection? */
- if (env && (pos = strstr(env, name))) {
+ if (__hugetlb_opts.features &&
+ (pos = strstr(__hugetlb_opts.features, name))) {
INFO("Overriding feature %s: ", name);
/* If feature is preceeded by 'no_' then turn it off */
- if (((pos - 3) >= env) && !strncmp(pos - 3, "no_", 3))
+ if (((pos - 3) >= __hugetlb_opts.features) &&
+ !strncmp(pos - 3, "no_", 3))
INFO_CONT("no\n");
else {
INFO_CONT("yes\n");