summaryrefslogtreecommitdiff
path: root/cmd/nvedit.c
diff options
context:
space:
mode:
authorQuentin Schulz <quentin.schulz@bootlin.com>2018-07-09 19:16:25 +0200
committerTom Rini <trini@konsulko.com>2018-07-20 15:55:08 -0400
commit6c90f62338226040513742921e718058f3273afb (patch)
treeb09b257d31ac3e2876ae4fa158e5bc3025737f1c /cmd/nvedit.c
parentd219415544f099c5e553a556dc277377b9dbf64f (diff)
env: add the same prefix to error messages to make it detectable by tests
The error message should start with `## Error: ` so that it's easily detectable by tests without needing to have a complex regexp for matching all possible error message patterns. Let's add the `## Error: ` prefix to the error messages since it's the one already in use. Suggested-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stephen Warren <swarren@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'cmd/nvedit.c')
-rw-r--r--cmd/nvedit.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 796867c62c..87c2a86050 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -960,7 +960,8 @@ NXTARG: ;
H_MATCH_KEY | H_MATCH_IDENT,
&ptr, size, argc, argv);
if (len < 0) {
- pr_err("Cannot export environment: errno = %d\n", errno);
+ pr_err("## Error: Cannot export environment: errno = %d\n",
+ errno);
return 1;
}
sprintf(buf, "%zX", (size_t)len);
@@ -980,7 +981,8 @@ NXTARG: ;
H_MATCH_KEY | H_MATCH_IDENT,
&res, ENV_SIZE, argc, argv);
if (len < 0) {
- pr_err("Cannot export environment: errno = %d\n", errno);
+ pr_err("## Error: Cannot export environment: errno = %d\n",
+ errno);
return 1;
}
@@ -995,7 +997,8 @@ NXTARG: ;
return 0;
sep_err:
- printf("## %s: only one of \"-b\", \"-c\" or \"-t\" allowed\n", cmd);
+ printf("## Error: %s: only one of \"-b\", \"-c\" or \"-t\" allowed\n",
+ cmd);
return 1;
}
#endif
@@ -1115,7 +1118,8 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
if (himport_r(&env_htab, ptr, size, sep, del ? 0 : H_NOCLEAR,
crlf_is_lf, 0, NULL) == 0) {
- pr_err("Environment import failed: errno = %d\n", errno);
+ pr_err("## Error: Environment import failed: errno = %d\n",
+ errno);
return 1;
}
gd->flags |= GD_FLG_ENV_READY;