summaryrefslogtreecommitdiff
path: root/futility/cmd_vbutil_key.c
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-06-28 14:53:57 +0800
committerCommit Bot <commit-bot@chromium.org>2019-07-22 09:13:52 +0000
commit772908aef95bf21d139a06c45c674241da9af6ac (patch)
treed32ab63b53062636af662950f960071d1dcb0415 /futility/cmd_vbutil_key.c
parenta529598bd4efc3355952e609fed17b504a738ea7 (diff)
downloadvboot-772908aef95bf21d139a06c45c674241da9af6ac.tar.gz
vboot/futility: update fatal errors to use FATAL
Previously, a mix of: - DIE - Fatal (customly defined in cmd_vbutil_kernel.c) - VbExError ... were all used to print an error message and exit. In the case of futility, standardize on using the FATAL macro defined in futility.h. BUG=b:124141368 TEST=Check that FATAL works correctly: $ build/futility/futility vbutil_key --in a --out a --algorithm 18 FATAL: do_vbutil_key: Unknown option TEST=make clean && make runtests BRANCH=none Change-Id: I97ca1153dc36e7208c69185883518c52d5d75293 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1679799 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'futility/cmd_vbutil_key.c')
-rw-r--r--futility/cmd_vbutil_key.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/futility/cmd_vbutil_key.c b/futility/cmd_vbutil_key.c
index 27e601ed..48abfbe5 100644
--- a/futility/cmd_vbutil_key.c
+++ b/futility/cmd_vbutil_key.c
@@ -103,7 +103,7 @@ static int do_pack(const char *infile, const char *outfile, uint32_t algorithm,
return 0;
}
- VbExError("Unable to parse either .keyb or .pem from %s\n", infile);
+ FATAL("Unable to parse either .keyb or .pem from %s\n", infile);
return 1;
}
@@ -154,8 +154,7 @@ static int do_unpack(const char *infile, const char *outfile)
return 0;
}
- VbExError("Unable to parse either .vbpubk or vbprivk from %s\n",
- infile);
+ FATAL("Unable to parse either .vbpubk or vbprivk from %s\n", infile);
return 1;
}
@@ -175,7 +174,7 @@ static int do_vbutil_key(int argc, char *argv[])
switch (i) {
case '?':
/* Unhandled option */
- VbExError("Unknown option\n");
+ FATAL("Unknown option\n");
parse_error = 1;
break;
case OPT_HELP:
@@ -189,7 +188,7 @@ static int do_vbutil_key(int argc, char *argv[])
case OPT_KEY_VERSION:
version = strtoul(optarg, &e, 0);
if (!*optarg || (e && *e)) {
- VbExError("Invalid --version\n");
+ FATAL("Invalid --version\n");
parse_error = 1;
}
break;
@@ -197,7 +196,7 @@ static int do_vbutil_key(int argc, char *argv[])
case OPT_ALGORITHM:
algorithm = strtoul(optarg, &e, 0);
if (!*optarg || (e && *e)) {
- VbExError("Invalid --algorithm\n");
+ FATAL("Invalid --algorithm\n");
parse_error = 1;
}
break;