summaryrefslogtreecommitdiff
path: root/env
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2020-07-07 20:51:34 +0200
committerTom Rini <trini@konsulko.com>2020-07-31 10:13:00 -0400
commitef9bef2bfed36424a3a6678d76d9eb7b710de1ac (patch)
tree0612229dac11709f0ecbd4f3438b501461ea428a /env
parent0f036bf4b87e6416f5c4d23865a62a62d9073c20 (diff)
env: Add H_DEFAULT flag
Add another internal environment flag which indicates that the operation is resetting the environment to the default one. This allows the env code to discern between import of external environment and reset to default. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'env')
-rw-r--r--env/common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/env/common.c b/env/common.c
index 088b2aebb4..0db56e610a 100644
--- a/env/common.c
+++ b/env/common.c
@@ -81,6 +81,7 @@ void env_set_default(const char *s, int flags)
debug("Using default environment\n");
}
+ flags |= H_DEFAULT;
if (himport_r(&env_htab, (char *)default_environment,
sizeof(default_environment), '\0', flags, 0,
0, NULL) == 0)
@@ -99,7 +100,7 @@ int env_set_default_vars(int nvars, char * const vars[], int flags)
* Special use-case: import from default environment
* (and use \0 as a separator)
*/
- flags |= H_NOCLEAR;
+ flags |= H_NOCLEAR | H_DEFAULT;
return himport_r(&env_htab, (const char *)default_environment,
sizeof(default_environment), '\0',
flags, 0, nvars, vars);