Skip to contentSkip to conversation

Relax check for valid environment in __hconfig

PATCH Superseded Alexander Kabaev 1 participant 1 message Jan 10, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Relax check for valid environment in __hconfig

The function only needs env_get to be functional, so check do env_valid flag instead. There is no reason why this function should not work if environment is available early.

---
 common/hwconfig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/hwconfig.c +1 -1
index e5186d7796..d7aed7b31a 100644
@@ -76,7 +76,7 @@ static const char *__hwconfig(const char *opt, size_t *arglen,
 
 	/* if we are passed a buffer use it, otherwise try the environment */
 	if (!env_hwconfig) {
-		if (!(gd->flags & GD_FLG_ENV_READY)) {
+		if (gd->env_valid != ENV_INVALID) {
 			printf("WARNING: Calling __hwconfig without a buffer "
 					"and before environment is ready\n");
 			return NULL;
Signature · 1 line
2.15.1