mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-10 17:41:54 +00:00
cgpt_wrapper: Print error if execv() fails.
This shows an error message when cgpt.bin failed to run, with its reason. Without this patch, "cgpt" would just fail and return -1 in that case making it difficult to know the reason of the failure. BUG=chrome-os-partner:36061 TEST=replaced this binary in storm recovery initramfs 6699.0.0 and it shows the error message if cgpt.bin is not installed. BRANCH=None Change-Id: I3ffaba5a63c491ac7d5b16086d5ae21005f40317 Reviewed-on: https://chromium-review.googlesource.com/251868 Reviewed-by: Alex Deymo <deymo@chromium.org> Commit-Queue: Alex Deymo <deymo@chromium.org> Trybot-Ready: Alex Deymo <deymo@chromium.org> Tested-by: Alex Deymo <deymo@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
317bb498a6
commit
3fec0e47bd
@@ -6,6 +6,7 @@
|
||||
* device is an MTD device, this utility will read the GPT structures from
|
||||
* FMAP, invokes "cgpt" on that, and writes the result back to NOR flash. */
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <inttypes.h>
|
||||
@@ -171,5 +172,8 @@ int main(int argc, const char *argv[]) {
|
||||
return -1;
|
||||
}
|
||||
argv[0] = real_cgpt;
|
||||
return execv(argv[0], (char * const *)argv);
|
||||
if (execv(argv[0], (char * const *)argv) == -1) {
|
||||
err(-2, "execv(%s) failed", real_cgpt);
|
||||
}
|
||||
return -2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user