summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2014-01-04 10:04:19 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2014-01-04 10:04:19 +1100
commit6a15eb2350426d285130e4c9d84c0bdb6575547a (patch)
tree67cb9f11f22daaddac79e69f4bb317fdc840cfce
parentcfc6523619c62d3eee505f53e7a18b253742961a (diff)
downloaddevice-tree-compiler-6a15eb2350426d285130e4c9d84c0bdb6575547a.tar.gz
Die on failed /incbin/ seeks
Failing to open an input file, with /include/ or /incbin/ is treated as immediately fatal inside srcfile_relative_open(). However, filing to seek() to the requested offset in an /incbin/ is not. This is a bit oddly inconsistent, and leaves us with a strange case that's awkward to deal with down the line. So, get rid of it and have failed seeks on an /incbin/ be immediately fatal. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--dtc-parser.y7
1 files changed, 3 insertions, 4 deletions
diff --git a/dtc-parser.y b/dtc-parser.y
index efe81dd..bed857e 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -226,10 +226,9 @@ propdata:
if ($6 != 0)
if (fseek(f, $6, SEEK_SET) != 0)
- print_error("Couldn't seek to offset %llu in \"%s\": %s",
- (unsigned long long)$6,
- $4.val,
- strerror(errno));
+ die("Couldn't seek to offset %llu in \"%s\": %s",
+ (unsigned long long)$6, $4.val,
+ strerror(errno));
d = data_copy_file(f, $8);