diff options
author | Jakub Czapiga <jacz@semihalf.com> | 2022-08-02 14:06:48 +0200 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-08-05 13:26:13 +0000 |
commit | 7d3dd82630e7505fe2804551c61e12e08c9fae4e (patch) | |
tree | 9ce50c6df4c65a40784a447b5d57c0afc74c2c77 | |
parent | 91ae3a544c237655379173a8e818c1057576166b (diff) | |
download | vboot-7d3dd82630e7505fe2804551c61e12e08c9fae4e.tar.gz |
host/lib/cbfstool: Fail on subprocess error
Make cbfstool_truncate() fail critically on subprocess execution error.
cbfstool is mandatory, so it should always be available.
If subprocess_run(), then either cbfstool is not available, or code is
incorrect, so it should not return.
BUG=none
TEST=make runfutiltests
BRANCH=none
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I17089d0cc2512a25f25cafe616caa79845a7e078
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3804563
Commit-Queue: Jakub Czapiga <czapiga@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Jakub Czapiga <czapiga@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
-rw-r--r-- | host/lib/cbfstool.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/host/lib/cbfstool.c b/host/lib/cbfstool.c index ff70f3d2..8f547066 100644 --- a/host/lib/cbfstool.c +++ b/host/lib/cbfstool.c @@ -48,8 +48,11 @@ vb2_error_t cbfstool_truncate(const char *file, const char *region, status = subprocess_run(argv, &subprocess_null, &output, &subprocess_null); - if (status < 0) - return VB2_ERROR_CBFSTOOL; + if (status < 0) { + fprintf(stderr, "%s(): cbfstool invocation failed: %m\n", + __func__); + exit(1); + } /* Positive exit code means something is wrong with image. Return zero as new size, because it might be problem with missing CBFS.*/ |