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>
This commit is contained in:
@@ -226,9 +226,8 @@ propdata:
|
|||||||
|
|
||||||
if ($6 != 0)
|
if ($6 != 0)
|
||||||
if (fseek(f, $6, SEEK_SET) != 0)
|
if (fseek(f, $6, SEEK_SET) != 0)
|
||||||
print_error("Couldn't seek to offset %llu in \"%s\": %s",
|
die("Couldn't seek to offset %llu in \"%s\": %s",
|
||||||
(unsigned long long)$6,
|
(unsigned long long)$6, $4.val,
|
||||||
$4.val,
|
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
|
||||||
d = data_copy_file(f, $8);
|
d = data_copy_file(f, $8);
|
||||||
|
|||||||
Reference in New Issue
Block a user