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

Myles

Signed-off-by: Myles Watson <[EMAIL PROTECTED]>
Index: util/lar/stream.c
===================================================================
--- util/lar/stream.c	(revision 613)
+++ util/lar/stream.c	(working copy)
@@ -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;
-- 
coreboot mailing list
[email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to