Author: myles Date: 2008-02-21 22:02:19 +0100 (Thu, 21 Feb 2008) New Revision: 615
Modified: coreboot-v3/util/lar/stream.c Log: 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
Modified: coreboot-v3/util/lar/stream.c =================================================================== --- coreboot-v3/util/lar/stream.c 2008-02-21 20:34:35 UTC (rev 614) +++ coreboot-v3/util/lar/stream.c 2008-02-21 21:02:19 UTC (rev 615) @@ -946,6 +946,9 @@
ptr = mapfile(filename, &size);
+ if (ptr == MAP_FAILED) + return -1; + if (elfparse() && iself(ptr)) { output_elf_segments(lar, pathname, ptr, size, thisalgo); return 0;