提交 6c90f623 编写于 作者: Q Quentin Schulz 提交者: Tom Rini

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: NStephen Warren <swarren@wwwdotorg.org>
Signed-off-by: NQuentin Schulz <quentin.schulz@bootlin.com>
Reviewed-by: NSimon Glass <sjg@chromium.org>
Reviewed-by: NStephen Warren <swarren@nvidia.com>
Tested-by: NStephen Warren <swarren@nvidia.com>
上级 d2194155
......@@ -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;
......
......@@ -79,7 +79,8 @@ void set_default_env(const char *s, int flags)
if (himport_r(&env_htab, (char *)default_environment,
sizeof(default_environment), '\0', flags, 0,
0, NULL) == 0)
pr_err("Environment import failed: errno = %d\n", errno);
pr_err("## Error: Environment import failed: errno = %d\n",
errno);
gd->flags |= GD_FLG_ENV_READY;
gd->flags |= GD_FLG_ENV_DEFAULT;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册