summaryrefslogtreecommitdiff
path: root/tools/env
diff options
context:
space:
mode:
authorAndreas Fenkart <andreas.fenkart@digitalstrom.com>2016-04-19 22:43:41 +0200
committerTom Rini <trini@konsulko.com>2016-05-27 09:56:19 -0400
commitcedb341e7f44f4686c8c0afb149a9f7940be110a (patch)
tree1c2f345446a979e97602162dd1e1871dade7cb48 /tools/env
parentc3a23e8b5f7c13d9de389d25d756a7da64bc5144 (diff)
downloadu-boot-imx-cedb341e7f44f4686c8c0afb149a9f7940be110a.zip
u-boot-imx-cedb341e7f44f4686c8c0afb149a9f7940be110a.tar.gz
u-boot-imx-cedb341e7f44f4686c8c0afb149a9f7940be110a.tar.bz2
tools/env: fw_printenv pass value_only as argument
Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
Diffstat (limited to 'tools/env')
-rw-r--r--tools/env/fw_env.c6
-rw-r--r--tools/env/fw_env.h4
-rw-r--r--tools/env/fw_env_main.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 0c44807..aa39485 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -239,7 +239,7 @@ int parse_aes_key(char *key, uint8_t *bin_key)
* Print the current definition of one, or more, or all
* environment variables
*/
-int fw_printenv (int argc, char *argv[])
+int fw_printenv(int argc, char *argv[], int value_only)
{
char *env, *nxt;
int i, rc = 0;
@@ -262,7 +262,7 @@ int fw_printenv (int argc, char *argv[])
return 0;
}
- if (printenv_args.name_suppress && argc != 1) {
+ if (value_only && argc != 1) {
fprintf(stderr,
"## Error: `-n' option requires exactly one argument\n");
return -1;
@@ -283,7 +283,7 @@ int fw_printenv (int argc, char *argv[])
}
val = envmatch (name, env);
if (val) {
- if (!printenv_args.name_suppress) {
+ if (!value_only) {
fputs (name, stdout);
putc ('=', stdout);
}
diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h
index 7345922..d4daeea 100644
--- a/tools/env/fw_env.h
+++ b/tools/env/fw_env.h
@@ -67,7 +67,7 @@ struct common_args {
extern struct common_args common_args;
struct printenv_args {
- int name_suppress;
+ int value_only;
};
extern struct printenv_args printenv_args;
@@ -78,7 +78,7 @@ extern struct setenv_args setenv_args;
int parse_aes_key(char *key, uint8_t *bin_key);
-int fw_printenv(int argc, char *argv[]);
+int fw_printenv(int argc, char *argv[], int value_only);
char *fw_getenv(char *name);
int fw_setenv(int argc, char *argv[]);
int fw_parse_script(char *fname);
diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c
index 3706d8f..2a45a0d 100644
--- a/tools/env/fw_env_main.c
+++ b/tools/env/fw_env_main.c
@@ -151,7 +151,7 @@ int parse_printenv_args(int argc, char *argv[])
EOF) {
switch (c) {
case 'n':
- printenv_args.name_suppress = 1;
+ printenv_args.value_only = 1;
break;
case 'a':
case 'c':
@@ -240,7 +240,7 @@ int main(int argc, char *argv[])
}
if (do_printenv) {
- if (fw_printenv(argc, argv) != 0)
+ if (fw_printenv(argc, argv, printenv_args.value_only))
retval = EXIT_FAILURE;
} else {
if (!setenv_args.script_file) {