Commit 6c90f62338226040513742921e718058f3273afb
Committed by
Tom Rini
1 parent
d219415544
Exists in
smarc_8mq_lf_v2020.04
and in
11 other branches
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>
Showing 2 changed files with 10 additions and 5 deletions Side-by-side Diff
cmd/nvedit.c
... | ... | @@ -960,7 +960,8 @@ |
960 | 960 | H_MATCH_KEY | H_MATCH_IDENT, |
961 | 961 | &ptr, size, argc, argv); |
962 | 962 | if (len < 0) { |
963 | - pr_err("Cannot export environment: errno = %d\n", errno); | |
963 | + pr_err("## Error: Cannot export environment: errno = %d\n", | |
964 | + errno); | |
964 | 965 | return 1; |
965 | 966 | } |
966 | 967 | sprintf(buf, "%zX", (size_t)len); |
... | ... | @@ -980,7 +981,8 @@ |
980 | 981 | H_MATCH_KEY | H_MATCH_IDENT, |
981 | 982 | &res, ENV_SIZE, argc, argv); |
982 | 983 | if (len < 0) { |
983 | - pr_err("Cannot export environment: errno = %d\n", errno); | |
984 | + pr_err("## Error: Cannot export environment: errno = %d\n", | |
985 | + errno); | |
984 | 986 | return 1; |
985 | 987 | } |
986 | 988 | |
... | ... | @@ -995,7 +997,8 @@ |
995 | 997 | return 0; |
996 | 998 | |
997 | 999 | sep_err: |
998 | - printf("## %s: only one of \"-b\", \"-c\" or \"-t\" allowed\n", cmd); | |
1000 | + printf("## Error: %s: only one of \"-b\", \"-c\" or \"-t\" allowed\n", | |
1001 | + cmd); | |
999 | 1002 | return 1; |
1000 | 1003 | } |
1001 | 1004 | #endif |
... | ... | @@ -1115,7 +1118,8 @@ |
1115 | 1118 | |
1116 | 1119 | if (himport_r(&env_htab, ptr, size, sep, del ? 0 : H_NOCLEAR, |
1117 | 1120 | crlf_is_lf, 0, NULL) == 0) { |
1118 | - pr_err("Environment import failed: errno = %d\n", errno); | |
1121 | + pr_err("## Error: Environment import failed: errno = %d\n", | |
1122 | + errno); | |
1119 | 1123 | return 1; |
1120 | 1124 | } |
1121 | 1125 | gd->flags |= GD_FLG_ENV_READY; |
env/common.c
... | ... | @@ -79,7 +79,8 @@ |
79 | 79 | if (himport_r(&env_htab, (char *)default_environment, |
80 | 80 | sizeof(default_environment), '\0', flags, 0, |
81 | 81 | 0, NULL) == 0) |
82 | - pr_err("Environment import failed: errno = %d\n", errno); | |
82 | + pr_err("## Error: Environment import failed: errno = %d\n", | |
83 | + errno); | |
83 | 84 | |
84 | 85 | gd->flags |= GD_FLG_ENV_READY; |
85 | 86 | gd->flags |= GD_FLG_ENV_DEFAULT; |