This is a pretty trivial patch that returns an error message when the
file is not found instead of seg faulting. test with: lar -a coreboot.rom nonexistant_file.bin Signed-off-by: Myles Watson <mylesgw@gmail.com> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://coreboot.org/repository/coreboot-v3@615 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
f4b9678b8e
commit
897ea2e08b
1 changed files with 3 additions and 0 deletions
|
|
@ -946,6 +946,9 @@ int lar_add_file(struct lar *lar, char *name)
|
|||
|
||||
ptr = mapfile(filename, &size);
|
||||
|
||||
if (ptr == MAP_FAILED)
|
||||
return -1;
|
||||
|
||||
if (elfparse() && iself(ptr)) {
|
||||
output_elf_segments(lar, pathname, ptr, size, thisalgo);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue