[coreboot] r615 - coreboot-v3/util/lar
svn at coreboot.org
svn at coreboot.org
Thu Feb 21 22:02:20 CET 2008
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 at gmail.com>
Acked-by: Ronald G. Minnich <rminnich at 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;
More information about the coreboot
mailing list