diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-01-20 13:30:17 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-01-20 16:33:03 +0100 |
commit | 7ed52f887036fb0f4c1c4ccb38b72fd766082410 (patch) | |
tree | 6f28455be4aa89e425627d1fd25a0d1d850de9af /common/startup.c | |
parent | a32ba9323999073cd4fa804b8238197233739f16 (diff) | |
download | barebox-7ed52f887036fb0f4c1c4ccb38b72fd766082410.tar.gz barebox-7ed52f887036fb0f4c1c4ccb38b72fd766082410.tar.xz |
startup: Use IS_ENABLED for loading environment
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/startup.c')
-rw-r--r-- | common/startup.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/common/startup.c b/common/startup.c index 6513ba536a..c26bc5f225 100644 --- a/common/startup.c +++ b/common/startup.c @@ -110,16 +110,18 @@ void start_barebox (void) debug("initcalls done\n"); -#ifdef CONFIG_ENV_HANDLING - if (envfs_load(default_environment_path, "/env", 0)) { -#ifdef CONFIG_DEFAULT_ENVIRONMENT - printf("no valid environment found on %s. " - "Using default environment\n", - default_environment_path); - envfs_load("/dev/defaultenv", "/env", 0); -#endif + if (IS_ENABLED(CONFIG_ENV_HANDLING)) { + int ret; + + ret = envfs_load(default_environment_path, "/env", 0); + + if (ret && IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT)) { + printf("no valid environment found on %s. " + "Using default environment\n", + default_environment_path); + envfs_load("/dev/defaultenv", "/env", 0); + } } -#endif if (IS_ENABLED(CONFIG_COMMAND_SUPPORT)) { printf("running /env/bin/init...\n"); |